git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #38995 from yorickvP/rocksdb-jemalloc

rocksdb: use jemalloc 4.5.0

commitd17d4b70c95c68280fa644ba4e72d9fde6db48a2 authorYegor Timoshenko <yegortimoshenko@riseup.net> dateMon 16 Apr 2018, 14:34 (9 years ago) parent74ed06ec03f5f5
4 files changed+47−34
pkgs/development/libraries/jemalloc/common.nix+35 pkgs/development/libraries/jemalloc/default.nix+3−33 pkgs/development/libraries/jemalloc/jemalloc450.nix+6 pkgs/top-level/all-packages.nix+3−1
pkgs/development/libraries/jemalloc/common.nixnew file+35
@@ -0,0 +1,35 @@
1+{ stdenv, fetchurl, version, sha256, ... }@args:
2+
3+stdenv.mkDerivation (rec {
4+ name = "jemalloc-${version}";
5+ inherit version;
6+
7+ src = fetchurl {
8+ url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}.tar.bz2";
9+ inherit sha256;
10+ };
11+
12+ # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
13+ # then stops downstream builds (mariadb in particular) from detecting it. This
14+ # option should remove the prefix and give us a working jemalloc.
15+ configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix="
16+ # jemalloc is unable to correctly detect transparent hugepage support on
17+ # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
18+ # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
19+ ++ stdenv.lib.optional stdenv.isArm "--disable-thp";
20+ doCheck = true;
21+
22+ enableParallelBuilding = true;
23+
24+ meta = with stdenv.lib; {
25+ homepage = http://jemalloc.net;
26+ description = "General purpose malloc(3) implementation";
27+ longDescription = ''
28+ malloc(3)-compatible memory allocator that emphasizes fragmentation
29+ avoidance and scalable concurrency support.
30+ '';
31+ license = licenses.bsd2;
32+ platforms = platforms.all;
33+ maintainers = with maintainers; [ wkennington ];
34+ };
35+} // (builtins.removeAttrs args [ "stdenv" "fetchurl" "version" "sha256" ]))
pkgs/development/libraries/jemalloc/default.nix+3−33
@@ -1,40 +1,10 @@
11{ stdenv, fetchurl, fetchpatch }:
2−
3−stdenv.mkDerivation rec {
4− name = "jemalloc-${version}";
2+import ./common.nix {
3+ inherit stdenv fetchurl;
54 version = "5.0.1";
6−
7− src = fetchurl {
8− url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}.tar.bz2";
9− sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
10− };
11−
12− # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
13− # then stops downstream builds (mariadb in particular) from detecting it. This
14− # option should remove the prefix and give us a working jemalloc.
15− configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix="
16− # jemalloc is unable to correctly detect transparent hugepage support on
17− # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
18− # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
19− ++ stdenv.lib.optional stdenv.isArm "--disable-thp";
20− doCheck = true;
21−
5+ sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
226 patches = stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
237 url = "https://patch-diff.githubusercontent.com/raw/jemalloc/jemalloc/pull/1035.patch";
248 sha256 = "02y0q3dp253bipxv4r954nqipbjbj92p6ww9bx5bk3d8pa81wkqq";
259 });
26−
27− enableParallelBuilding = true;
28−
29− meta = with stdenv.lib; {
30− homepage = http://jemalloc.net;
31− description = "General purpose malloc(3) implementation";
32− longDescription = ''
33− malloc(3)-compatible memory allocator that emphasizes fragmentation
34− avoidance and scalable concurrency support.
35− '';
36− license = licenses.bsd2;
37− platforms = platforms.all;
38− maintainers = with maintainers; [ wkennington ];
39− };
4010}
pkgs/development/libraries/jemalloc/jemalloc450.nixnew file+6
@@ -0,0 +1,6 @@
1+{ stdenv, fetchurl }:
2+import ./common.nix {
3+ inherit stdenv fetchurl;
4+ version = "4.5.0";
5+ sha256 = "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl";
6+}
pkgs/top-level/all-packages.nix+3−1
@@ -9445,6 +9445,8 @@ with pkgs;
94459445
94469446 jemalloc = callPackage ../development/libraries/jemalloc { };
94479447
9448+ jemalloc450 = callPackage ../development/libraries/jemalloc/jemalloc450.nix { };
9449+
94489450 jshon = callPackage ../development/tools/parsing/jshon { };
94499451
94509452 json2hcl = callPackage ../development/tools/json2hcl { };
@@ -11302,7 +11304,7 @@ with pkgs;
1130211304
1130311305 rlog = callPackage ../development/libraries/rlog { };
1130411306
11305− rocksdb = callPackage ../development/libraries/rocksdb { };
11307+ rocksdb = callPackage ../development/libraries/rocksdb { jemalloc = jemalloc450; };
1130611308
1130711309 rocksdb_lite = rocksdb.override { enableLite = true; };
1130811310