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

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.

主站蜘蛛池模板: 秭归县| 蒙自县| 丰都县| 保亭| 博湖县| 西盟| 深泽县| 互助| 中宁县| 安远县| 宝坻区| 徐水县| 子长县| 巫山县| 舟山市| 凌源市| 阳城县| 临江市| 招远市| 翼城县| 徐闻县| 铜山县| 南丹县| 汶上县| 隆化县| 乌什县| 斗六市| 马龙县| 厦门市| 白朗县| 迁西县| 星子县| 陆良县| 望谟县| 鸡泽县| 靖州| 乾安县| 讷河市| 大庆市| 镇康县| 邻水|