From a1ba737c5ee13938f9d4208b2c67073caed14a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 24 May 2022 07:17:28 +0200 Subject: [PATCH] folly: enable jemalloc Folly does take advantage of jemalloc to expand allocations in-place when possible. --- pkgs/development/libraries/folly/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix index c3fe3ba2ce76..e2057b873cd0 100644 --- a/pkgs/development/libraries/folly/default.nix +++ b/pkgs/development/libraries/folly/default.nix @@ -16,6 +16,7 @@ , xz , zlib , zstd +, jemalloc , follyMobile ? false }: @@ -50,7 +51,10 @@ stdenv.mkDerivation rec { libunwind fmt_8 zstd - ]; + ] ++ lib.optional stdenv.isLinux jemalloc; + + # jemalloc headers are required in include/folly/portability/Malloc.h + propagatedBuildInputs = lib.optional stdenv.isLinux jemalloc; NIX_CFLAGS_COMPILE = [ "-DFOLLY_MOBILE=${if follyMobile then "1" else "0"}" "-fpermissive" ]; cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];