aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2020-10-30 23:18:24 +0100
committerRobert Hensing <robert@roberthensing.nl>2020-10-30 23:18:26 +0100
commitb43c13a9161daf1801188e61104debafa5243fe1 (patch)
treeb8c5e55865d724f4b5d812fadc958bcbfba11164 /src/libexpr
parentc4d903ddb009aa6472530699e154d85a24eac51d (diff)
BoehmGCStackAllocator: increase stack size to 8MB
The default stack size was not based on the normal stack size and was too small.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index ea7ba0a6a..486a9fc1a 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -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 {