Setting `MIMALLOC_SHOW_STATS` to ask mimalloc to print out something
after the process is done is the easiest way to verify that a
mimalloc-enabled Git is running.
So it better work and not try to write to a Win32 Console when it got a
regular file handle instead or, as is the case in Git for Windows'
regular Git Bash window, an emulated pseudo terminal.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let's not make `bcrypt.dl` a link-time bound library. Instead, load the
`BCryptGenRandom()` function dynamically. When needed. If needed.
This helps reduce the start-up cost of any mimalloc user because the
time spent on loading dynamic libraries is non-negligible.
Note: In contrast to how `os.c` loads libraries and obtains function
addresses, we cannot call `FreeLibrary(hDll)` here because that would
unload the `bcrypt` library before we want to use it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let's load the `GetProcessMemoryInfo()` function dynamically. When
needed. If needed.
This is necessary because the start-up cost spent on loading dynamic
libraries is non-negligible.
Note: In contrast to how `os.c` loads libraries and obtains function
addresses, we cannot call `FreeLibrary(hDll)` here because that would
unload the `bcrypt` library before we want to use it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `GetNumaProcessorNode()` symbol is not defined in Nano Server's DLLs
(because that function is long deprecated). This causes problems with
any executable that uses mimalloc when trying to run on Nano Server.
Instead of importing this function statically, try to import it
dynamically, and fall back gracefully if it cannot be loaded.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>