-
-
Notifications
You must be signed in to change notification settings - Fork 673
Description
Feature suggestion
When WebAssembly memories are grown, any existing ArrayBuffers are detached...unless we use the brand-new toResizableBuffer()
method on WebAssembly.Memory
objects.
Calling this method in our JS bindings would be beneficial for AssemblyScript because it prevents us (in bindings) and users from worrying about views into the Wasm memory detaching, because they won't detach and will actually grow automatically if the view isn't constructed with a set length: see the resizable ArrayBuffer proposal and the merged spec (see steps 4-9). This could, in the future, maybe let us pass TypedArrays to users without copying them in the ESM bindings, if we want to (re?)add that feature.
This change should be very very very simple (shouldn't take more than 10 or 20 lines of code).
This is being created as an issue first, because browsers haven't widely implemented this yet, so we have to wait until they do.