I'm wondering if it's possible (or on the roadmap, or if the question is
even sane) to have the various bytevector functions operate upon passed in
ArrayBuffer.

Or is there some manner to provide a view of a bytevector as an ArrayBuffer
from the default wasm memory in use.

For example, referencing below I mean to create the memory in JS and then
operate upon it in hoot module:
https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory

Specifically, there is this section which I'm wondering if supported in
some fashion:
"""
Originally you could only perform memory operations on a single memory in
the Wasm module, so while multiple Memory objects could be created, there
wasn't any point doing so. More recent implementations allow WebAssembly
memory instructions to operate on a specified memory. For more information
see Multiple memories in Understanding WebAssembly text format.
"""

The actual problem I'm trying to solve is an area of memory with one writer
and many readers that may span worklets. I could solve this in a number of
inefficient copy methods but something along the lines of above seems like
a better choice.

See also this comment which seems desirable:
https://github.com/WebAssembly/design/issues/1231#issuecomment-420466909

Currently I'm doing the following within a single worklet which isn't even
the more complicated case above and wondering if necessary:
https://codeberg.org/dskinner/shields-tyvm/src/commit/01130104d18a50367d839a639d12895f43298ec8/realtime_worklet.js#L792

Thanks,
Daniel

Reply via email to