Update mimalloc to 2.1.7#21548
Conversation
|
Oh, I guess we should make |
|
Could you open an upsteam llvm issue regarding |
kripken
left a comment
There was a problem hiding this comment.
Thanks!
Should we wait until dev-slice lands in their main branch? I would guess that would be when they consider it stable, but I don't actually know their dev practices.
| return ENOMEM; | ||
| } | ||
| return 0; | ||
| *addr = emmalloc_memalign(try_alignment, size); |
There was a problem hiding this comment.
Did the emmalloc alignment limitations get fixed?
There was a problem hiding this comment.
This was fixed via PR #21905 in the meantime. I also removed MIN_EMMALLOC_ALIGN initially, but let's leave that for now.
b7e3831 to
6906868
Compare
dev-slice branch|
Revised this PR to update mimalloc to 2.1.7 instead. This is ready for review now.
I just opened issue llvm/llvm-project#117433 for this. Commit 0dc7223 defines |
2830274 to
0dc7223
Compare
tools/system_libs.py
Outdated
| # disable `assert()` in emmalloc | ||
| '-DNDEBUG', | ||
| # avoid use of `__builtin_thread_pointer()` | ||
| # FIXME: https://github.com/llvm/llvm-project/issues/117433 |
There was a problem hiding this comment.
I'm not sure we want a FIXME here since we are using musl as our libc so this seems correct in any case.
tools/system_libs.py
Outdated
| '-DMI_MALLOC_OVERRIDE', | ||
| # TODO: add build modes that include debug checks 1,2,3 | ||
| '-DMI_DEBUG=0', | ||
| # disable `assert()` in emmalloc |
There was a problem hiding this comment.
| # disable `assert()` in emmalloc | |
| # disable `assert()` in mimalloc |
But do we not want this in debug builds?
There was a problem hiding this comment.
If we do, I think that we can/should make that a separate change.
There was a problem hiding this comment.
I think the comment is correct in this case, mimalloc uses mi_assert, which is already disabled.
emscripten/system/lib/mimalloc/include/mimalloc/types.h
Lines 563 to 569 in a090ba8
However, we also want to disable the assertions in the underlying emmalloc allocator, which we build as part of mimalloc:
emscripten/tools/system_libs.py
Lines 1818 to 1819 in a090ba8
emscripten/tools/system_libs.py
Line 1828 in a090ba8
emscripten/system/lib/emmalloc.c
Lines 33 to 35 in a090ba8
emscripten/system/lib/libc/musl/include/assert.h
Lines 5 to 9 in a090ba8
There was a problem hiding this comment.
Oh, it's for the underlying allocator. In that case it sounds ok. But can it be a separate change, or was it necessary for some reason to do in this PR?
There was a problem hiding this comment.
There's no specific reason to address it in this PR; it was discovered by accident while working on this. Split into PR #23016.
a090ba8 to
7040d13
Compare
|
Thanks @kleisauke ! |
No description provided.