5 # doc: https://github.com/ivmai/bdwgc/blob/v8.2.2/doc/README.macros (LARGE_CONFIG)
6 , enableLargeConfig ? false
11 stdenv.mkDerivation (finalAttrs: {
17 # "https://www.hboehm.info/gc/gc_source/gc-${finalAttrs.version}.tar.gz"
18 "https://github.com/ivmai/bdwgc/releases/download/v${finalAttrs.version}/gc-${finalAttrs.version}.tar.gz"
20 sha256 = "sha256-8wEHvLBi4JIKeQ//+lbZUSNIVGhZNkwjoUviZLOINqA=";
23 outputs = [ "out" "dev" "doc" ];
24 separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
28 "--with-libatomic-ops=none"
30 ++ lib.optional enableMmap "--enable-mmap"
31 ++ lib.optional enableLargeConfig "--enable-large-config";
33 # `gctest` fails under emulation on aarch64-darwin
34 doCheck = !(stdenv.isDarwin && stdenv.isx86_64);
36 enableParallelBuilding = true;
38 passthru.tests = nixVersions;
41 homepage = "https://hboehm.info/gc/";
42 description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
44 The Boehm-Demers-Weiser conservative garbage collector can be used as a
45 garbage collecting replacement for C malloc or C++ new. It allows you
46 to allocate memory basically as you normally would, without explicitly
47 deallocating memory that is no longer useful. The collector
48 automatically recycles memory when it determines that it can no longer
49 be otherwise accessed.
51 The collector is also used by a number of programming language
52 implementations that either use C as intermediate code, want to
53 facilitate easier interoperation with C libraries, or just prefer the
54 simple collector interface.
56 Alternatively, the garbage collector may be used as a leak detector for
57 C or C++ programs, though that is not its primary goal.
59 # non-copyleft, X11-style license
60 changelog = "https://github.com/ivmai/bdwgc/blob/v${finalAttrs.version}/ChangeLog";
61 license = "https://hboehm.info/gc/license.txt";
62 maintainers = with maintainers; [ AndersonTorres ];
63 platforms = platforms.all;