1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 07:22:43 +01:00

Remove a word from Env

This commit is contained in:
Eelco Dolstra 2019-04-23 01:11:50 +02:00
parent ae5b76a5a4
commit e392ff53e9
4 changed files with 55 additions and 31 deletions

View file

@ -82,9 +82,21 @@ void GC::gc()
case tEnv: {
auto obj2 = (Env *) obj;
push(obj2->up);
if (obj2->type != Env::HasWithExpr)
for (auto i = obj2->values; i < obj2->values + obj2->size; ++i)
push(*i);
for (auto i = obj2->values; i < obj2->values + obj2->getSize(); ++i)
push(*i);
break;
}
case tWithExprEnv: {
auto obj2 = (Env *) obj;
push(obj2->up);
break;
}
case tWithAttrsEnv: {
auto obj2 = (Env *) obj;
push(obj2->up);
push(obj2->values[0]);
break;
}
@ -229,6 +241,8 @@ std::pair<Size, Size> GC::Arena::freeUnmarked()
objSize = ((PtrList<Value> *) obj)->words();
break;
case tEnv:
case tWithExprEnv:
case tWithAttrsEnv:
objSize = ((Env *) obj)->words();
break;
default: