Repository navigation
Commit 3d65c60
committed
fix(mem): define MI_MINGW_UCRT64 for MinGW mimalloc builds
mimalloc 3.5.3 treats a MinGW build as having a process-attach hook only
when MI_MINGW_UCRT64 is defined (src/prim/windows/prim.c). Upstream's
CMake sets it; Makefile.cbm did not. src/prim/prim.c therefore also
compiled its constructor, and _mi_auto_process_init ran twice on Windows:
once from that constructor and once from the CRT TLS callback.
The second run flushes the delayed-output buffer to stderr again, and the
first flush had left a newline in it, so every Windows run started with a
blank line on stderr. That is what failed smoke-win's one-line --version
check. In the MI_DEBUG=2 test build the same second run reaches
mi_assert_internal(mi_out_default == NULL) in options.c, which aborts.
3.3.2 had no such condition.
Define it for IS_MINGW builds in both the production and the test
mimalloc flags. Every MinGW toolchain this repository builds with (MSYS2
CLANG64 and CLANGARM64) is UCRT. No vendored source changes.
Signed-off-by: Martin Vogel <[email protected]>1 parent 7e55bc1 commit 3d65c60
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
649 | 661 | | |
650 | 662 | | |
651 | 663 | | |
| |||
663 | 675 | | |
664 | 676 | | |
665 | 677 | | |
666 | | - | |
| 678 | + | |
667 | 679 | | |
668 | 680 | | |
669 | 681 | | |
670 | | - | |
| 682 | + | |
671 | 683 | | |
672 | 684 | | |
673 | 685 | | |
| |||
0 commit comments