- 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.
- 數(shù)據(jù)庫系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- Bootstrap Site Blueprints Volume II
- Apache Oozie Essentials
- Java EE 6 企業(yè)級應(yīng)用開發(fā)教程
- C語言程序設(shè)計案例教程(第2版)
- Microsoft Application Virtualization Cookbook
- 算法精粹:經(jīng)典計算機(jī)科學(xué)問題的Python實現(xiàn)
- 新編Premiere Pro CC從入門到精通
- Drupal 8 Configuration Management
- 算法訓(xùn)練營:提高篇(全彩版)
- NGINX Cookbook
- OpenResty完全開發(fā)指南:構(gòu)建百萬級別并發(fā)的Web應(yīng)用
- Scratch·愛編程的藝術(shù)家
- HTML+CSS+JavaScript編程入門指南(全2冊)
- Struts 2.x權(quán)威指南