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

  • Learn WebAssembly
  • Mike Rourke
  • 156字
  • 2021-08-13 15:38:54

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.

主站蜘蛛池模板: 堆龙德庆县| 江津市| 女性| 阳城县| 砚山县| 延寿县| 聂拉木县| 罗定市| 阳曲县| 竹山县| 普洱| 凤台县| 资中县| 乌拉特前旗| 库车县| 绥芬河市| 东乡县| 甘谷县| 铁岭市| 抚州市| 溧阳市| 衡东县| 察雅县| 鸡东县| 来安县| 慈利县| 兴业县| 武隆县| 锦屏县| 喜德县| 新丰县| 清河县| 神池县| 阿巴嘎旗| 沭阳县| 广宗县| 酒泉市| 建德市| 富平县| 紫金县| 霍林郭勒市|