File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ if (ENVIRONMENT_IS_PTHREAD) {
2323#endif
2424 {
2525 wasmMemory = new WebAssembly . Memory ( {
26- 'initial' : INITIAL_MEMORY / { { { WASM_PAGE_SIZE } } }
26+ 'initial' : INITIAL_MEMORY / { { { WASM_PAGE_SIZE } } } ,
2727#if ALLOW_MEMORY_GROWTH
28- #if MAXIMUM_MEMORY != FOUR_GB
29- ,
28+ // In theory we should not need to emit the maximum if we want "unlimited"
29+ // or 4GB of memory, but VMs error on that atm, see
30+ // https://github.com/emscripten-core/emscripten/issues/14130
31+ // And in the pthreads case we definitely need to emit a maximum. So
32+ // always emit one.
3033 'maximum' : { { { MAXIMUM_MEMORY } } } / { { { W A S M _ P A G E _ S I Z E } } }
31- #endif
3234#else
33- ,
3435 'maximum' : INITIAL_MEMORY / { { { WASM_PAGE_SIZE } } }
3536#endif // ALLOW_MEMORY_GROWTH
3637#if USE_PTHREADS
Original file line number Diff line number Diff line change @@ -3860,6 +3860,11 @@ def test_missing_signatures(self):
38603860 (int)&emscripten_run_script );
38613861 }''' )
38623862 self .set_setting ('MAIN_MODULE' , 1 )
3863+ # also test main module with 4GB of memory. we need to emit a "maximum"
3864+ # clause then, even though 4GB is the maximum; see
3865+ # https://github.com/emscripten-core/emscripten/issues/14130
3866+ self .set_setting ('ALLOW_MEMORY_GROWTH' , '1' )
3867+ self .set_setting ('MAXIMUM_MEMORY' , '4GB' )
38633868 self .do_runf ('test_sig.c' , '' )
38643869
38653870 @needs_dylink
You can’t perform that action at this time.
0 commit comments