File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ size_t emscripten_get_heap_max() {
155
155
}
156
156
157
157
int emscripten_resize_heap (size_t size ) {
158
- #ifdef EMSCRIPTEN_MEMORY_GROWTH
158
+ #if defined( EMSCRIPTEN_MEMORY_GROWTH ) && !defined( EMSCRIPTEN_PURE_WASI )
159
159
size_t old_size = __builtin_wasm_memory_size (0 ) * WASM_PAGE_SIZE ;
160
160
assert (old_size < size );
161
161
ssize_t diff = (size - old_size + WASM_PAGE_SIZE - 1 ) / WASM_PAGE_SIZE ;
Original file line number Diff line number Diff line change @@ -363,6 +363,8 @@ def metafunc(self, standalone):
363
363
if not can_do_standalone (self , impure ):
364
364
self .skipTest ('Test configuration is not compatible with STANDALONE_WASM' )
365
365
self .set_setting ('STANDALONE_WASM' )
366
+ if not impure :
367
+ self .set_setting ('PURE_WASI' )
366
368
# we will not legalize the JS ffi interface, so we must use BigInt
367
369
# support in order for JS to have a chance to run this without trapping
368
370
# when it sees an i64 on the ffi.
Original file line number Diff line number Diff line change @@ -8760,6 +8760,8 @@ def test_binaryen_2170_emscripten_atomic_cas_u8(self):
8760
8760
@also_with_standalone_wasm ()
8761
8761
def test_sbrk (self ):
8762
8762
self .do_runf (test_file ('sbrk_brk.cpp' ), 'OK.' )
8763
+ self .set_setting ('ALLOW_MEMORY_GROWTH' )
8764
+ self .do_runf (test_file ('sbrk_brk.cpp' ), 'OK.' )
8763
8765
8764
8766
def test_brk (self ):
8765
8767
self .emcc_args += ['-DTEST_BRK=1' ]
Original file line number Diff line number Diff line change @@ -2006,6 +2006,7 @@ class libstandalonewasm(MuslInternalLibrary):
2006
2006
2007
2007
def __init__ (self , ** kwargs ):
2008
2008
self .is_mem_grow = kwargs .pop ('is_mem_grow' )
2009
+ self .is_pure = kwargs .pop ('is_pure' )
2009
2010
self .nocatch = kwargs .pop ('nocatch' )
2010
2011
super ().__init__ (** kwargs )
2011
2012
@@ -2015,25 +2016,30 @@ def get_base_name(self):
2015
2016
name += '-nocatch'
2016
2017
if self .is_mem_grow :
2017
2018
name += '-memgrow'
2019
+ if self .is_pure :
2020
+ name += '-pure'
2018
2021
return name
2019
2022
2020
2023
def get_cflags (self ):
2021
2024
cflags = super ().get_cflags ()
2022
2025
cflags += ['-DNDEBUG' , '-DEMSCRIPTEN_STANDALONE_WASM' ]
2023
2026
if self .is_mem_grow :
2024
2027
cflags += ['-DEMSCRIPTEN_MEMORY_GROWTH' ]
2028
+ if self .is_pure :
2029
+ cflags += ['-DEMSCRIPTEN_PURE_WASI' ]
2025
2030
if self .nocatch :
2026
2031
cflags .append ('-DEMSCRIPTEN_NOCATCH' )
2027
2032
return cflags
2028
2033
2029
2034
@classmethod
2030
2035
def vary_on (cls ):
2031
- return super ().vary_on () + ['is_mem_grow' , 'nocatch' ]
2036
+ return super ().vary_on () + ['is_mem_grow' , 'is_pure' , ' nocatch' ]
2032
2037
2033
2038
@classmethod
2034
2039
def get_default_variation (cls , ** kwargs ):
2035
2040
return super ().get_default_variation (
2036
2041
is_mem_grow = settings .ALLOW_MEMORY_GROWTH ,
2042
+ is_pure = settings .PURE_WASI ,
2037
2043
nocatch = settings .DISABLE_EXCEPTION_CATCHING and not settings .WASM_EXCEPTIONS ,
2038
2044
** kwargs
2039
2045
)
You can’t perform that action at this time.
0 commit comments