You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current version of WebAssembly, at most one memory may be defined or imported in a single module, and all constructs implicitly reference this memory 0. This restriction may be lifted in future versions.
Just for your information, the memory is exposed to the JavaScript API through exportsObject, ie. instance.exports.mem1.
Yeah I know, the memory API isn't perfect right now, but we are not in the 1.* branch yet, so we are free to change it. Behind the scene, the runtime supports multiple memory, but we only read the first one if any. Using instance.exports.memory is indeed an interesting API.
Summary
At the current version of WebAssembly, an instance has at most one memory instance, but it may not be true in the future.
If there are more than one memory, the interface of
instance.memory
will not be the best interface.Additional details
http://webassembly.github.io/spec/core/syntax/modules.html#syntax-mem
Just for your information, the memory is exposed to the JavaScript API through
exportsObject
, ie.instance.exports.mem1
.https://webassembly.github.io/spec/js-api/#dom-module-exports
The text was updated successfully, but these errors were encountered: