WasmTable Class

A table (a table address).

public abstract class WasmTable : WasmExtern
Inheritance
WasmExtern WasmTable

Properties

NameDescription
KindGets the kind of the value.
SizeGets the number of elements.
TypeGets the type of the table.

Gets the kind of the value.

public override WasmExternKind Kind { get; }

Property value

WasmExternKind

Size

Gets the number of elements.

public abstract ulong Size { get; }

Property value

ulong

Type

Gets the type of the table.

public abstract WasmTableType Type { get; }

Property value

WasmTableType

Methods

NameDescription
Get(ulong)Reads an element (table_read).
Grow(ulong, WasmValue)Grows the table (table_grow) and returns its previous size.
Set(ulong, WasmValue)Writes an element (table_write).

Get(ulong)

Reads an element (table_read).

public abstract WasmValue Get(ulong index)

Parameters

index ulong

Returns

WasmValue

Exceptions

WasmAllocationException
The index is out of bounds.

Grow(ulong, WasmValue)

Grows the table (table_grow) and returns its previous size.

public abstract ulong Grow(ulong delta, WasmValue value)

Parameters

delta ulong
The number of elements to add.
value WasmValue
The value of the new elements.

Returns

ulong

Exceptions

WasmAllocationException
The table cannot grow.

Set(ulong, WasmValue)

Writes an element (table_write).

public abstract void Set(ulong index, WasmValue value)

Parameters

index ulong
value WasmValue

Exceptions

WasmAllocationException
The index is out of bounds.
WasmTypeMismatchException
The value does not match the type of the elements.