aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 05:57:04 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 05:57:04 +0100
commit439f88b7d7596ccd4d1130b5c3e65f6e2ad9658a (patch)
tree822ecc0362c79cb4c6e15332f369a076cd4b4458 /src/libexpr/eval.cc
parent3f3badffc908a61a522b13bb6783442082d6d8d9 (diff)
Merge pull request #9399 from edolstra/revert-vlas
Revert use of boost::container::small_vector in the evaluator (cherry picked from commit 6832d18ac734f4b855f97c07b158491dd01cefcd) Change-Id: I7f10af0c8b8a8beb4b1e36424120995f4ed82738
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index d8dc81ef9..f5eacd0e0 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -28,7 +28,6 @@
#include <sys/resource.h>
#include <nlohmann/json.hpp>
-#include <boost/container/small_vector.hpp>
#if HAVE_BOEHMGC
@@ -1702,7 +1701,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
/* We have all the arguments, so call the primop with
the previous and new arguments. */
- Value * vArgs[maxPrimOpArity];
+ Value * vArgs[arity];
auto n = argsDone;
for (Value * arg = &vCur; arg->isPrimOpApp(); arg = arg->primOpApp.left)
vArgs[--n] = arg->primOpApp.right;
@@ -1765,11 +1764,11 @@ void ExprCall::eval(EvalState & state, Env & env, Value & v)
// 4: about 60
// 5: under 10
// This excluded attrset lambdas (`{...}:`). Contributions of mixed lambdas appears insignificant at ~150 total.
- boost::container::small_vector<Value *, 4> vArgs(args.size());
+ Value * vArgs[args.size()];
for (size_t i = 0; i < args.size(); ++i)
vArgs[i] = args[i]->maybeThunk(state, env);
- state.callFunction(vFun, args.size(), vArgs.data(), v, pos);
+ state.callFunction(vFun, args.size(), vArgs, v, pos);
}
@@ -2008,8 +2007,8 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
return result;
};
- boost::container::small_vector<Value, conservativeStackReservation> values(es->size());
- Value * vTmpP = values.data();
+ Value values[es->size()];
+ Value * vTmpP = values;
for (auto & [i_pos, i] : *es) {
Value & vTmp = *vTmpP++;