ElementSegment

ElementSegment

data class ElementSegment

Representation of an element segment for a table.

From the docs:

The initial contents of a table is uninitialized. The elem component of a module defines a vector of element segments that initialize a subrange of a table, at a given offset, from a static vector of elements.


elem ::= {table tableidx, offset expr, init vec(funcidx)}

The offset is given by a constant expression.

Note: In the current version of WebAssembly, at most one table is allowed in a module. Consequently, the only valid tableidx is 0.

Fields

Name Description
val tableIndex: Index<Table>
val offset: Offset
val init: List<Index<Function>>

Constructors

<init>

constructor(tableIndex: Index<Table>, offset: Offset, init: List<Index<Function>>)

Representation of an element segment for a table.

From the docs:

The initial contents of a table is uninitialized. The elem component of a module defines a vector of element segments that initialize a subrange of a table, at a given offset, from a static vector of elements.


elem ::= {table tableidx, offset expr, init vec(funcidx)}

The offset is given by a constant expression.

Note: In the current version of WebAssembly, at most one table is allowed in a module. Consequently, the only valid tableidx is 0.

Parameters

Name Description
tableIndex: Index<Table>
offset: Offset
init: List<Index<Function>>

Extensions

validate

fun ElementSegment.validate(context: Module): Module

Validates the ElementSegment node.

Receiver

Name Description
ElementSegment

Parameters

Name Description
context: Module

ReturnValue

Name Description
Module