MemorySlice<T extends Object> class abstract base

A list of primitives living in a DVPlatformMemory.

Indexing is constant-time across chunks. Every access checks that the arena has not been reset or disposed since the slice was handed out, and throws StateError if it has.

Properties

addresses → List<_I>
The native address of each chunk's first element, for FFI and for sharing with another isolate without a copy.
no setter
chunks → List<List<T>>
The contiguous runs of storage, in order, for hot loops.
no setter
elementBytes → int
Bytes per stored element.
final
hashCode → int
The hash code for this object.
no setterinherited
isValid → _B
Whether the arena still holds this slice's memory.
no setter
length → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
storage → String
The storage representation, e.g. int16, float64.
no setter

Methods

fill(T value) → void
Sets every element to value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toList() → List<T>
A copy of the elements, on the Dart heap.
toString() → String
A string representation of this object.
inherited
transform(T f(T value)) → void
Replaces every element with f of it.
transformAsync(T f(T value), {_I batch = 1 << 16}) → Future<void>
transform, yielding to the event loop every batch elements so the UI stays live.

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](_I index) → T
operator []=(_I index, T value) → void