Hello, Is there a good, stable means of accessing the WASM memory from JavaScript?
I’m trying to compile GNU AWK (gawk) to WASM. gawk expects to run via main(), so that’s what I’m doing via callMain(). The safest approach is to load/compile the WASM every time gawk runs, but that’s quite slow. To speed things up I’m trying to run callMain() multiple times with the same WASM state. gawk, though, leaves a bunch of globals around, which need to be reset each time callMain() is called. On my workstation I’m using Emscripten 3.1.31, which exposes Module.asm.memory. Using that I can save the memory’s state before the first invocation, then restore it before each successive one. This works well enough. Apparently in newer Emscripten releases, though, `Module.asm` no longer exists; thus, my little trick breaks. I’d ideally like not to have to supply my own memory; right now I’m deferring to Emscripten’s defaults, and I’d like to retain that behaviour. Is there, or could there be, a reliable way to clear WASM’s memory from JavaScript? Thank you! cheers, -Felipe Gasper Toronto -- 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 emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/884ED095-86DB-4306-9968-A924BB3189C1%40felipegasper.com.