Using shared WebAssembly.Memory (SharedArrayBuffer) with non-multithreaded builds? #16596
-
Hi, I get the following runtime error when trying to use a
My use case is this:
I have tried some other things, like passing |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Linking with Module['wasmMemory'] = new WebAssembly.Memory({
'initial': INITIAL_MEMORY / 65536,
'maximum': INITIAL_MEMORY / 65536,
'shared': true
}); Perhaps check the wasm file, and see that it declares the memory properly as shared? (Is there a chance you are seeing an old wasm file in the cache?) You should see this: $ wasm-dis b.out.wasm | grep memory
(import "env" "memory" (memory $mimport$0 (shared 256 256))) |
Beta Was this translation helpful? Give feedback.
Linking with
-sSHARED_MEMORY
should support this use case, and it works when I try it on hello world, by adding this right before the check ofModule['wasmMemory']
:Perhaps check the wasm file, and see that it declares the memory properly as shared? (Is there a chance you are seeing an old wasm file in the cache?) You should see this: