table.init
Copy functions references from data into a table. You can store a collection of function references
in a passive data object and copy them into a table before they need to be used.
Syntax
table.init $tableLabel $elementLabel
Parameters
$tableLabel Optional
If there is no label then the default table is used. If used then this points to a (table...)
object.
$elementLabel
This points to a passive data (element...)
object to copy the elements from.
Stack In
i32 |
The offset within the destination table to copy to. |
i32 |
The offset within the source element to copy from. |
i32 |
The number of elements to copy. |
Example
(table $table 10 funcref)
(elem $passiveElement func $add $sub $mul)
(func $setupTable
i32.const 0
i32.const 0
i32.const 3
table.init $table $passiveElement
)