aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/primops.hh')
-rw-r--r--src/libexpr/primops.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libexpr/primops.hh b/src/libexpr/primops.hh
index 930e7f32a..45486608f 100644
--- a/src/libexpr/primops.hh
+++ b/src/libexpr/primops.hh
@@ -8,6 +8,22 @@
namespace nix {
+/**
+ * For functions where we do not expect deep recursion, we can use a sizable
+ * part of the stack a free allocation space.
+ *
+ * Note: this is expected to be multiplied by sizeof(Value), or about 24 bytes.
+ */
+constexpr size_t nonRecursiveStackReservation = 128;
+
+/**
+ * Functions that maybe applied to self-similar inputs, such as concatMap on a
+ * tree, should reserve a smaller part of the stack for allocation.
+ *
+ * Note: this is expected to be multiplied by sizeof(Value), or about 24 bytes.
+ */
+constexpr size_t conservativeStackReservation = 16;
+
struct RegisterPrimOp
{
typedef std::vector<PrimOp> PrimOps;