Le 12/06/2024 à 04:45, Sutou Kouhei a écrit :
It seems that we need to disable MI_OVERRIDE explicitly to not define malloc() in libmimalloc.so: https://github.com/microsoft/mimalloc/blob/03020fbf81541651e24289d2f7033a772a50f480/CMakeLists.txt#L10
Yes, that's what we do when building the bundled mimalloc :-)
But we can't use LD_PRELOAD with the option. So system mimalloc will not disable MI_OVERRIDE.
A system mimalloc package should ideally provide two shared libraries: * a `libmimalloc.so` with MI_OVERRIDE disabled * a `libmimalloc-override.so` with MI_OVERRIDE enabled But it's not our decision to make anyway.
Can we use "-lc -lmimalloc" for system mimalloc?
I don't know, it sounds rather fragile to me. Are we sure this would always prevent any problem from happening?
Regards Antoine.