FakeSharedBuffer class final

A SharedBuffer backed by ordinary process memory, for VM tests.

Mirrors the web implementation's semantics: the asXxxList() accessors are aliasing views over one allocation, and the atomic methods perform (trivially atomic, single-threaded) 32-bit read-modify-write operations with the same wrap-around and range-checking behavior.

FakeWorkerTransport passes instances by reference, simulating how a real SharedArrayBuffer is shared rather than cloned. A fake buffer cannot cross a real worker boundary.

Implemented types

Constructors

FakeSharedBuffer(int byteLength)
Allocates byteLength bytes of zeroed fake-shared memory.

Properties

byteLength int
Total length of the buffer, in bytes.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asFloat64List() Float64List
A 64-bit float view over the buffer (byteLength ~/ 8 elements).
override
asInt32List() Int32List
A signed 32-bit view over the buffer (byteLength ~/ 4 elements).
override
asUint8List() Uint8List
A byte view over the whole buffer.
override
atomicAdd(int index, int value) int
Atomically adds value to the 32-bit element at index and returns the previous value. index is in Int32 elements, not bytes.
override
atomicLoad(int index) int
Atomically reads the 32-bit element at index.
override
atomicStore(int index, int value) → void
Atomically writes value to the 32-bit element at index.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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