-
Notifications
You must be signed in to change notification settings - Fork 9
Required API: WASI.prototype.setMemory() #7
Comments
After spending some time on this, and thinking about #4 (comment), I think this is the wrong approach. The memory doesn't need to be part of the JS WASI instance at all. The memory should be passed to |
the memory has to be updated at the start of every wasi function that will access the memory: https://github.com/devsnek/node-wasi/blob/master/src/index.js#L599 this will be fixed in the future by passing memory views directly via interface types. |
@devsnek the problem I'm encountering is that when I try to access the |
this happens when the memory is resized (that's why i have a test that specifically just calls |
If I'm understanding you correctly, that means this object must be the EDIT: Based on https://webassembly.github.io/spec/js-api/#dom-memory-grow, I think that's accurate. |
As discussed a bit in this thread.
Currently, the memory is passed to the
WASI
constructor in JS, and set in the bindings here.This needs to be extracted into a separate function so that the following sequence of operations is supported:
WebAssembly.Instance
.WebAssembly.Instance
and associate it with the WASI instance.The text was updated successfully, but these errors were encountered: