File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1227,6 +1227,7 @@ struct mallinfo emmalloc_mallinfo() {
1227
1227
}
1228
1228
EMMALLOC_ALIAS (mallinfo , emmalloc_mallinfo );
1229
1229
1230
+ #if 0
1230
1231
// Note! This function is not fully multithreading safe: while this function is running, other threads should not be
1231
1232
// allowed to call sbrk()!
1232
1233
static int trim_dynamic_heap_reservation (size_t pad ) {
@@ -1280,12 +1281,19 @@ static int trim_dynamic_heap_reservation(size_t pad) {
1280
1281
// All successful, and we actually trimmed memory!
1281
1282
return 1 ;
1282
1283
}
1284
+ #endif
1283
1285
1284
1286
int emmalloc_trim (size_t pad ) {
1287
+ // Reducing the size of the sbrk region is currently broken.
1288
+ // See https://github.com/emscripten-core/emscripten/issues/23343
1289
+ // And https://github.com/emscripten-core/emscripten/pull/13442
1290
+ return 0 ;
1291
+ /*
1285
1292
MALLOC_ACQUIRE();
1286
1293
int success = trim_dynamic_heap_reservation(pad);
1287
1294
MALLOC_RELEASE();
1288
1295
return success;
1296
+ */
1289
1297
}
1290
1298
EMMALLOC_ALIAS (malloc_trim , emmalloc_trim )
1291
1299
Original file line number Diff line number Diff line change @@ -821,6 +821,7 @@ def test_emmalloc_memory_statistics(self):
821
821
@no_4gb ('output is sensitive to absolute data layout' )
822
822
@no_asan ('ASan does not support custom memory allocators' )
823
823
@no_lsan ('LSan does not support custom memory allocators' )
824
+ @disabled ('https://github.com/emscripten-core/emscripten/issues/23343' )
824
825
def test_emmalloc_trim (self ):
825
826
self .set_setting ('MALLOC' , 'emmalloc' )
826
827
self .emcc_args += ['-sINITIAL_MEMORY=128MB' , '-sALLOW_MEMORY_GROWTH' , '-sMAXIMUM_MEMORY=2147418112' ]
You can’t perform that action at this time.
0 commit comments