Files: 75864bd5ab5d242349cbe42dcc37db22b686e9c5 / docs / index.md
2658 bytesRaw
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Table of Contents
prepare
Prepares a binary by injecting getter and setter function for memory, globals and tables.
Parameters
binary
ArrayBuffer a wasm binaryinclude
Object (optional, default{memory:true,table:true}
)include.memory
Boolean whether or not to include memory (optional, defaulttrue
)include.table
Boolean whether or not to include the function table (optional, defaulttrue
)include.globals
Array<Boolean> whether or not to include a given global. Each index in the array stands for a global index. Indexes that are set to false or left undefined will not be persisted. By default all globals are persisted. (optional, defaultArray.<true>
)
symbol
String a string used to prefix the injected setter and getter functions (optional, default'_'
)
Returns ArrayBuffer the resulting wasm binary
hibernate
Given a Webassembly Instance this will produce an Object containing the current state of the instance
Parameters
instance
Webassembly.Instancesymbol
String the symbol that will be used to find the injected functions (optional, default'_'
)
Returns Object the state of the wasm instance
resume
Resumes a previously hibernated Webassembly instance
Parameters
instance
WebAssembly.Instancestate
Object the previous state of the wasm instance
Returns WebAssembly.Instance
Built with git-ssb-web