- Learn WebAssembly
- Mike Rourke
- 227字
- 2021-08-13 15:38:54
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.
- 零基礎學C++程序設計
- DevOps for Networking
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- Ext JS Data-driven Application Design
- 單片機應用技術
- 重學Java設計模式
- HTML5入門經典
- 微信小程序入門指南
- 硅谷Python工程師面試指南:數據結構、算法與系統設計
- PLC應用技術(三菱FX2N系列)
- 深度學習:Java語言實現
- LabVIEW虛擬儀器入門與測控應用100例
- FFmpeg開發實戰:從零基礎到短視頻上線
- App Inventor 2 Essentials
- IBM Cognos TM1 Developer's Certification guide