IGrowableSharedDataBlock Interface

A growable shared data block of the script engine whose bytes never move (the bytes of a shared WebAssembly.Memory, which the native code of a WebAssembly runtime reads and writes), created by IJsAdapter<TValue>.CreateGrowableSharedDataBlock. Its members can be called from any thread.

public interface IGrowableSharedDataBlock

Properties

NameDescription
AddressThe address of the first byte, which never changes while the block is alive.
ByteLengthThe current length of the block in bytes.
DataBlockThe data block of the SharedArrayBuffer objects of the block (see IJsAdapter<TValue>.GetSharedDataBlock).

Address

The address of the first byte, which never changes while the block is alive.

nint Address { get; }

Property value

nint

ByteLength

The current length of the block in bytes.

int ByteLength { get; }

Property value

int

DataBlock

The data block of the SharedArrayBuffer objects of the block (see IJsAdapter<TValue>.GetSharedDataBlock).

object DataBlock { get; }

Property value

object

Methods

NameDescription
SetWaiters(ISharedDataBlockWaiters)Makes Atomics.wait, Atomics.waitAsync and Atomics.notify use waiters for the SharedArrayBuffer objects of the block (the waiters of the WebAssembly runtime). It is called before the scripts get a buffer of the block.
TryGrow(int)Grows the block to newByteLength bytes (the new bytes are zeroed), and returns false when it is less than the current length or greater than the maximum length of the block.

SetWaiters(ISharedDataBlockWaiters)

Makes Atomics.wait, Atomics.waitAsync and Atomics.notify use waiters for the SharedArrayBuffer objects of the block (the waiters of the WebAssembly runtime). It is called before the scripts get a buffer of the block.

void SetWaiters(ISharedDataBlockWaiters waiters)

Parameters

waiters ISharedDataBlockWaiters

TryGrow(int)

Grows the block to newByteLength bytes (the new bytes are zeroed), and returns false when it is less than the current length or greater than the maximum length of the block.

bool TryGrow(int newByteLength)

Parameters

newByteLength int

Returns

bool