maxPrimOpArity: 64 -> 8

This makes stack usage significantly more compact, allowing larger
amounts of data to be processed on the same stack.

PrimOp functions with more than 8 positional (curried) arguments
should use an attrset instead.
This commit is contained in:
Robert Hensing 2023-11-16 11:27:31 +01:00
parent 0daccb1121
commit 12c91a823e

View file

@ -20,10 +20,10 @@ namespace nix {
/**
* We put a limit on primop arity because it lets us use a fixed size array on
* the stack. 16 is already an impractical number of arguments. Use an attrset
* the stack. 8 is already an impractical number of arguments. Use an attrset
* argument for such overly complicated functions.
*/
constexpr size_t maxPrimOpArity = 64;
constexpr size_t maxPrimOpArity = 8;
class Store;
class EvalState;