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

WebAssembly.Memory

The WebAssembly.Memory object holds the memory accessed by a WebAssembly Instance. This memory can be accessed and changed from both JavaScript and WebAssembly. To create a new instance of Memory, you need to pass an object with an initial and (optional) maximum value to the WebAssembly.Memory() constructor. These values are in units of WebAssembly pages, where one page is 64 KB. You increase the size of the memory instance by calling the grow() function with a single parameter that represents the number of WebAssembly pages to grow by. You can also access the current buffer contained in the memory instance through its buffer property.

MDN describes two ways to get to a WebAssembly.Memory object. The first way is to construct it from JavaScript (var memory = new WebAssembly.Memory(...)), while the second way is to have it exported by a WebAssembly module. The important takeaway is that memory can be passed easily between JavaScript and WebAssembly.

主站蜘蛛池模板: 武威市| 沙洋县| 绍兴市| 红河县| 长丰县| 兴国县| 建瓯市| 东明县| 绍兴县| 海口市| 清镇市| 特克斯县| 深水埗区| 开化县| 同心县| 汤阴县| 旅游| 施秉县| 新兴县| 宜阳县| 富平县| 平顶山市| 永济市| 刚察县| 微山县| 西乡县| 永安市| 海城市| 思南县| 林州市| 乐山市| 博客| 漳州市| 茌平县| 龙口市| 泸定县| 富蕴县| 九江县| 英山县| 铜鼓县| 上思县|