Currently DMD is hard coded to use the static runtime for windows, this means that shared libraries are going to be using multiple different "malloc()" so it isn't safe to pass around between DLLs if they are going to be loaded and unloaded. Switching to use the dynamic runtime instead should fix this.
https://github.com/dlang/dmd/blob/v2.071.2/src/glue.c#L929
Comment #1 by robert.schadek — 2024-12-13T18:50:13Z