Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions packaging/dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@ scope: {
requiredSystemFeatures = [ ];
};

boehmgc = pkgs.boehmgc.override {
enableLargeConfig = true;
};
boehmgc =
(pkgs.boehmgc.override {
enableLargeConfig = true;
}).overrideAttrs
(attrs: {
# Increase the initial mark stack size to avoid stack
# overflows, since these inhibit parallel marking (see
# GC_mark_some()). To check whether the mark stack is too
# small, run Nix with GC_PRINT_STATS=1 and look for messages
# such as `Mark stack overflow`, `No room to copy back mark
# stack`, and `Grew mark stack to ... frames`.
NIX_CFLAGS_COMPILE = "-DINITIAL_MARK_STACK_SIZE=1048576";
});

# TODO Hack until https://github.com/NixOS/nixpkgs/issues/45462 is fixed.
boost =
Expand Down
5 changes: 3 additions & 2 deletions src/libexpr/eval-gc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# include <pthread_np.h>
# endif

# include <gc/gc.h>
# include <gc/gc_cpp.h>
# include <gc/gc_allocator.h>

# include <boost/coroutine2/coroutine.hpp>
Expand Down Expand Up @@ -53,6 +51,9 @@ static inline void initGCReal()

GC_INIT();

/* Enable parallel marking. */
GC_allow_register_threads();

/* Register valid displacements in case we are using alignment niches
for storing the type information. This way tagged pointers are considered
to be valid, even when they are not aligned. */
Expand Down
3 changes: 2 additions & 1 deletion src/libexpr/include/nix/expr/eval-gc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

#include <cstddef>

// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS`
// For `NIX_USE_BOEHMGC`
#include "nix/expr/config.hh"

#if NIX_USE_BOEHMGC

# define GC_INCLUDE_NEW
# define GC_THREADS 1

# include <gc/gc.h>
# include <gc/gc_cpp.h>
Expand Down
3 changes: 0 additions & 3 deletions src/libexpr/include/nix/expr/eval-inline.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#include "nix/expr/eval-error.hh"
#include "nix/expr/eval-settings.hh"

// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS`
#include "nix/expr/config.hh"

namespace nix {

/**
Expand Down
2 changes: 0 additions & 2 deletions src/libexpr/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ if bdw_gc.found()
define_value = cxx.has_function(funcspec).to_int()
configdata_priv.set(define_name, define_value)
endforeach
# Affects ABI, because it changes what bdw_gc itself does!
configdata_pub.set('GC_THREADS', 1)
endif
# Used in public header. Affects ABI!
configdata_pub.set('NIX_USE_BOEHMGC', bdw_gc.found().to_int())
Expand Down
Loading