In asm.js builds defining Module['buffer'] is enough. In wasm builds you need to provide both Module['wasmMemory'] and Module['buffer']. The use case of providing a precreated memory buffer was strongly defined for asm.js, not sure how well we support it currently for wasm. One complication there is that the size of the wasm heap is pre-defined in the .wasm module file, so when precreating your own memory, you will need to create it with the same size that the .wasm module expects. (That limitation may be a reason that providing your own Module['wasmMemory'] might not work that well out of the box but you may need to do some custom hacks to the preamble&postamble)
ti 11. kesäk. 2019 klo 3.16 Joshua Minter ([email protected]) kirjoitti: > > The two "documented" (albeit barely) methods for providing your own memory > buffer are: > - Module['buffer'] which according to the code will create the memory buffer > but not setup the wasmMemory object and thus crash. Confirmed from testing > - Module['wasmMemory'] which according to the code will be only used when > compiling for pthreads. Also confirmed from testing > > -- > 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/ff3defe7-b46a-4fad-9033-27623fdaed3a%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CA%2B6sJ-0mMJ2%3DkmVbgLVQWANrybAh0L16s8Gmjo5v%2BoE8a3d%3DLw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
