Hi, I want to use shared memory for my WebAssembly module. It's needed for js-dos. Currently emulation works in worker and frame updates are send using postMessage. I want to use SharedArrayBuffer to avoid copying/sending big rgba data.
I dont' need to use pthread or threading, I just want to share memory between worker and main process. How I can say emscripten to generate "shared" memory imort. I found similar question here: https://github.com/emscripten-core/emscripten/issues/12098 As suggested I tried wasm2wat and then wat2wasm, but it not working for me. Looks like it affects -s INVOKE_RUN=0, because after wasm2wat my module immediately starts and I can't provide own memory. Without wasm2wat I have this error: LinkError: WebAssembly.instantiate(): mismatch in shared state of memory, declared = *0*, imported = *1* After wasm2wat this: LinkError: WebAssembly.instantiate(): mismatch in shared state of memory, declared = *1*, imported = *0* Can we add some pass to binaryen for turning non-shared memory into shared? -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVFj%3D%3DNiy1r-Y7YFgAdbGs%2BS-rYgr3dTnyi%2BJEcagb3u%2Bw%40mail.gmail.com.
