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) {
23
23
#endif
24
24
{
25
25
wasmMemory = new WebAssembly . Memory ( {
26
- 'initial' : INITIAL_MEMORY / { { { WASM_PAGE_SIZE } } }
26
+ 'initial' : INITIAL_MEMORY / { { { WASM_PAGE_SIZE } } } ,
27
27
#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.
30
33
'maximum' : { { { MAXIMUM_MEMORY } } } / { { { W A S M _ P A G E _ S I Z E } } }
31
- #endif
32
34
#else
33
- ,
34
35
'maximum' : INITIAL_MEMORY / { { { WASM_PAGE_SIZE } } }
35
36
#endif // ALLOW_MEMORY_GROWTH
36
37
#if USE_PTHREADS
Original file line number Diff line number Diff line change @@ -3860,6 +3860,11 @@ def test_missing_signatures(self):
3860
3860
(int)&emscripten_run_script );
3861
3861
}''' )
3862
3862
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' )
3863
3868
self .do_runf ('test_sig.c' , '' )
3864
3869
3865
3870
@needs_dylink
You can’t perform that action at this time.
0 commit comments