MAXIMUM_MEMORY supporting values based on browser

34 views
Skip to first unread message

Brian Gavin

unread,
Oct 1, 2020, 9:25:56 AM10/1/20
to emscripten-discuss
Now that Firefox supports wasm pthreads.   I would like to avoid having to make 2 versions of our WASM module.   Chrome supports a max memory of ~4GB and Firefox ~2GB.   Is there a way for me to have a different value for MAXIMUM_MEMORY based on the browser.   I am using it with pthreads and memory growth turned on.

Thanks 
Brian Gavin

Alon Zakai

unread,
Oct 1, 2020, 1:49:21 PM10/1/20
to emscripte...@googlegroups.com
If you build with MAXIMUM_MEMORY=-1 that means "no specified limit". In that case I think each browser should allow growth as much as it possibly can.

(see src/settings.js for MAXIMUM_MEMORY for more details, including why the default is 2GB and not -1, but basically, -1 has some minor code size downsides)

--
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-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/2bd79de4-65bc-445b-8dac-e8bd8bb6c802n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages