mirror of
https://github.com/NixOS/nix.git
synced 2025-11-19 08:49:35 +01:00
move ExprAttrs data into Exprs::alloc
This commit is contained in:
parent
4b97f1130a
commit
fcf3bdcac8
1 changed files with 11 additions and 0 deletions
|
|
@ -401,6 +401,17 @@ ExprAttrs::bindInheritSources(EvalState & es, const std::shared_ptr<const Static
|
|||
|
||||
void ExprAttrs::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> & env)
|
||||
{
|
||||
// Move storage into the Exprs arena
|
||||
{
|
||||
auto arena = es.mem.exprs.alloc;
|
||||
AttrDefs newAttrs{std::move(*attrs), arena};
|
||||
attrs.emplace(std::move(newAttrs), arena);
|
||||
DynamicAttrDefs newDynamicAttrs{std::move(*dynamicAttrs), arena};
|
||||
dynamicAttrs.emplace(std::move(newDynamicAttrs), arena);
|
||||
if (inheritFromExprs)
|
||||
inheritFromExprs = std::make_unique<std::pmr::vector<Expr *>>(std::move(*inheritFromExprs), arena);
|
||||
}
|
||||
|
||||
if (es.debugRepl)
|
||||
es.exprEnvs.insert(std::make_pair(this, env));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue