nix: fix withMimalloc (#516347)

This commit is contained in:
John Ericson
2026-05-14 01:31:50 +00:00
committed by GitHub
@@ -1,6 +1,7 @@
{
lib,
mkMesonExecutable,
stdenv,
nix-store,
nix-expr,
@@ -12,6 +13,11 @@
# Configuration Options
version,
# Whether to link against mimalloc for malloc override.
# Significantly improves evaluation performance on allocation-heavy
# workloads (~10-15% on large evaluations).
withMimalloc ? !stdenv.hostPlatform.isWindows,
}:
mkMesonExecutable (finalAttrs: {
@@ -25,10 +31,11 @@ mkMesonExecutable (finalAttrs: {
nix-expr
nix-main
nix-cmd
mimalloc
];
]
++ lib.optional ((lib.versionAtLeast version "2.35pre") && withMimalloc) mimalloc;
mesonFlags = [
mesonFlags = lib.optionals (lib.versionAtLeast version "2.35pre") [
(lib.mesonEnable "mimalloc" withMimalloc)
];
meta = {