MemoryGate class

Constructors

MemoryGate({int maxBytes = 256 * 1024 * 1024, int safetyMarginBytes = 1024 * 1024 * 1024})

Properties

currentBytes → int
Current bytes reserved.
no setter
hasCapacity → bool
Whether there's capacity for bytes more.
no setter
hashCode → int
The hash code for this object.
no setterinherited
maxBytes → int
Maximum bytes allowed in-flight at once.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
safetyMarginBytes → int
Safety margin: keep at least this many bytes free.
final

Methods

acquire(int bytes) → Future<void>
Acquire bytes worth of memory. Waits if capacity is exceeded.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release(int bytes) → void
Release bytes of previously acquired memory.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited