Skip to content

Commit

Permalink
BoehmGCStackAllocator: increase stack size to 8MB
Browse files Browse the repository at this point in the history
The default stack size was not based on the normal stack size and
was too small.
  • Loading branch information
roberth committed Oct 30, 2020
1 parent c4d903d commit b43c13a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ static void * oomHandler(size_t requested)
}

class BoehmGCStackAllocator : public StackAllocator {
boost::coroutines2::protected_fixedsize_stack stack;
boost::coroutines2::protected_fixedsize_stack stack {
// We allocate 8 MB, the default max stack size on NixOS.
// A smaller stack might be quicker to allocate but reduces the stack
// depth available for source filter expressions etc.
std::max(boost::context::stack_traits::default_size(), static_cast<std::size_t>(8 * 1024 * 1024))
};

public:
boost::context::stack_context allocate() override {
Expand Down

0 comments on commit b43c13a

Please sign in to comment.