mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

conditionally disable mimalloc override/hook

Open Kamayuq opened this issue 9 months ago • 2 comments

I have not found any but is there an option to conditionally disable mimalloc on startup and forward all calls to the system allocator instead? This is mainly for using it together with ASan or whendoing A/B performance testing.

If it's not available already a possible option to trigger this would be the use of an environment variable before startup.

Kamayuq avatar Feb 25 '25 18:02 Kamayuq

On Windows with dynamic override (using mimalloc-redirect.dll), you can set the environment variable MIMALLOC_DISABLE_REDIRECT=1 to disable dynamic redirection. (see the bin/readme.md for this) Hope this helps!

daanx avatar Feb 25 '25 21:02 daanx

I saw that now and it helps, but we also have a linux build and if the static override could act on a similar Environment variable that would solve the issue for us.

Kamayuq avatar Feb 26 '25 16:02 Kamayuq