mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
shared_ptr for StaticEnv
This commit is contained in:
parent
176911102c
commit
21071bfdeb
8 changed files with 57 additions and 69 deletions
|
@ -186,11 +186,11 @@ static void import(EvalState & state, const Pos & pos, Value & vPath, Value * vS
|
|||
Env * env = &state.allocEnv(vScope->attrs->size());
|
||||
env->up = &state.baseEnv;
|
||||
|
||||
StaticEnv staticEnv(false, &state.staticBaseEnv);
|
||||
auto staticEnv = std::shared_ptr<StaticEnv>(new StaticEnv(false, state.staticBaseEnv.get()));
|
||||
|
||||
unsigned int displ = 0;
|
||||
for (auto & attr : *vScope->attrs) {
|
||||
staticEnv.vars[attr.name] = displ;
|
||||
staticEnv->vars[attr.name] = displ;
|
||||
env->values[displ++] = attr.value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue