mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

add support for static override on Windows

Open Noxybot opened this issue 8 months ago • 4 comments

Noxybot avatar Apr 15 '25 04:04 Noxybot

I don't think this can really work? Nowadays, one should link with the universal C runtime library which is a DLL so there is no way to statically override the allocator (unless I guess we link to a static CRT -- is that the use case that you envision?).

daanx avatar Jun 08 '25 22:06 daanx

Nowadays, one should link with the universal C runtime library which is a DLL

There are multiple reasons why one would want to link CRT statically.

  1. Security (harder to do DLL injection)
  2. Perf (sometime not having to load DLL might make your process to start up faster)
  3. Consistency
  4. Not having to use mimalloc-redirrect.dll and avoid shipping arm64 version for Windows (this is actually a big one. Static overrides would work for x86 binaries on Arm64EC)

Having said this, I can also confirm that we using this patch internally for our app that links CRT statically and it works fine / robust :)

Noxybot avatar Jun 08 '25 23:06 Noxybot

@microsoft-github-policy-service agree company="Roblox"

Noxybot avatar Jun 08 '25 23:06 Noxybot

Hi, what's the status on this PR? We also link the CRT statically and would be very much interested in this

mat-gas avatar Oct 15 '25 08:10 mat-gas