1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

Inline allocValue()

This commit is contained in:
Eelco Dolstra 2019-04-29 09:08:50 +02:00
parent 14f7a60755
commit 9b822de4ef
2 changed files with 6 additions and 8 deletions

View file

@ -539,13 +539,6 @@ inline Value * EvalState::lookupVar(Env * env, const ExprVar & var, bool noEval)
}
Ptr<Value> EvalState::allocValue()
{
nrValues++;
return gc.alloc<Value>(Value::words());
}
Ptr<Env> EvalState::allocEnv(size_t size, size_t prevWith, Tag type)
{
nrEnvs++;

View file

@ -286,7 +286,12 @@ public:
void autoCallFunction(Bindings & args, Value & fun, Value & res);
/* Allocation primitives. */
Ptr<Value> allocValue();
Ptr<Value> allocValue()
{
nrValues++;
return gc.alloc<Value>(Value::words());
}
Ptr<Env> allocEnv(size_t size, size_t prevWith = 0, Tag type = tEnv);
// Note: the resulting Value is only reachable as long as vAttrs