Repository navigation
Conversation
Allows mimalloc to handle allocation failures from its underlying emmalloc allocator and fall back gracefully. This is an alternative to the `mi_prim_heap_has_room()` check introduced in microsoft/mimalloc@0fec3da, which Emscripten does not use.
There was a problem hiding this comment.
Code Review
This pull request updates the configuration for mimalloc to default to a non-aborting malloc behavior (ABORTING_MALLOC=0), allowing it to gracefully handle allocation failures from its underlying emmalloc allocator. Consequently, the explicit -sABORTING_MALLOC=0 flag has been removed from the mimalloc test cases in test/test_core.py. Additionally, a comment in tools/system_libs.py was updated to clarify the usage of the page map in mi_free(). There are no review comments, so I have no feedback to provide.
| # always use the page map in `mi_free()`, as we don't support large | ||
| # aligned allocations well (needed for aligned page metadata) |
There was a problem hiding this comment.
Drive-by: I've synced this comment with:
emscripten/system/lib/mimalloc/include/mimalloc/bits.h
Lines 155 to 156 in 51ed955
sbc100
left a comment
There was a problem hiding this comment.
But don't we want the default behaviour of ABORTING_MALLOC to be the same for all allocators.
i.e. does ABORTING_MALLOC work at the mimalloc level? Perhaps it should?
Allows mimalloc to handle allocation failures from its underlying
emmalloc allocator and fall back gracefully.
This is an alternative to the
mi_prim_heap_has_room()checkintroduced in microsoft/mimalloc@0fec3da, which Emscripten does not
use.