官术网_书友最值得收藏!

WebAssembly.Table

The WebAssembly.Table object is an array-like structure that is used to store function references. Just as with WebAssembly.Memory, a Table can be accessed and changed from both JavaScript and WebAssembly. As of the time of writing, tables can only store function references, but it's likely that, as the technology evolves, additional entities will be able to be stored in tables as well.

To create a new Table instance, you need to pass an object with an element, initial, and (optional) maximum value. The element member is a string that represents the type of value stored in the table; currently the only valid value is "anyfunc" (for functions). The initial and maximum values represent the number of elements in the WebAssembly Table.

You can access the number of elements in the Table instance using the length property. The instance also includes methods to manipulate and query elements in the table. The get() method allows you to access the element at the given index, which is passed in as a parameter. The set() method allows you to set an element at the index specified as the first parameter to the value specified as the second parameter (per the preceding note, only functions are supported). Finally, grow() allows you to increase the size of the Table instance (number of elements) by the number passed in as a parameter.

主站蜘蛛池模板: 阳江市| 松江区| 闸北区| 和田市| 南郑县| 陆河县| 沈阳市| 大同县| 湄潭县| 咸宁市| 和林格尔县| 宝清县| 兰州市| 铜梁县| 色达县| 瑞金市| 潼关县| 嫩江县| 手游| 凤台县| 陆川县| 明星| 蚌埠市| 高雄县| 铜鼓县| 吉安县| 黎川县| 耒阳市| 勐海县| 台东市| 伊宁县| 连山| 琼结县| 红河县| 遂川县| 丰台区| 同德县| 化隆| 黔东| 奉节县| 龙泉市|