1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

primops: Err on the side of less stack usage

Try to stay away from stack overflows.

These small vectors use stack space. Most instances will not need
to allocate because in general most things are small, and large
things are worth heap allocating.

16 * 3 * word = 384 bytes is still quite a bit, but these functions
tend not to be part of deep recursions.
This commit is contained in:
Robert Hensing 2023-11-16 12:48:37 +01:00
parent 91114a6fa4
commit 898c47384f
2 changed files with 3 additions and 3 deletions

View file

@ -2015,7 +2015,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
return result;
};
boost::container::small_vector<Value, 64> values(es->size());
boost::container::small_vector<Value, 16> values(es->size());
Value * vTmpP = values.data();
for (auto & [i_pos, i] : *es) {