Note that the second argument here (and everywhere that std::nothrow_t is uses) is passed by reference, but _ZnwmRKSt9nothrow_t is passing mi_nothrow_t by value.
On most platform, especially since all the overrides simply ignore this argument, this is not an issue, but on Wasm C signatures are requires to match between compilation unit.
As it stands, under wasm64, we get a linker warning about the std::nothrow_t argument having a different width in libmimalloc compared to libc++.
Apologies for the late fix; I pushed a potential fix to dev/dev-slice where I redefine mi_nothrow_t to be a void* -- I guess this will fix the linker error as well?
alloc-override.c overrides
operator new
, etc, using C functions with C++ mangled names. e.g:The requires signature of this function can be seen via c++filt:
Note that the second argument here (and everywhere that
std::nothrow_t
is uses) is passed by reference, but_ZnwmRKSt9nothrow_t
is passingmi_nothrow_t
by value.On most platform, especially since all the overrides simply ignore this argument, this is not an issue, but on Wasm C signatures are requires to match between compilation unit.
As it stands, under wasm64, we get a linker warning about the
std::nothrow_t
argument having a different width in libmimalloc compared to libc++.See https://github.com/emscripten-core/emscripten/pull/21127 for the proposed downstream fix.