mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
* Store Value nodes outside of attribute sets. I.e., Attr now stores
a pointer to a Value, rather than the Value directly. This improves the effectiveness of garbage collection a lot: if the Value is stored inside the set directly, then any live pointer to the Value causes all other attributes in the set to be live as well.
This commit is contained in:
parent
64c3325b0b
commit
41c45a9b31
15 changed files with 150 additions and 130 deletions
|
@ -45,7 +45,7 @@ static void showAttrs(EvalState & state, bool strict, bool location,
|
|||
|
||||
XMLOpenElement _(doc, "attr", xmlAttrs);
|
||||
printValueAsXML(state, strict, location,
|
||||
a.value, doc, context, drvsSeen);
|
||||
*a.value, doc, context, drvsSeen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,16 +90,16 @@ static void printValueAsXML(EvalState & state, bool strict, bool location,
|
|||
Path drvPath;
|
||||
a = v.attrs->find(state.sDrvPath);
|
||||
if (a != v.attrs->end()) {
|
||||
if (strict) state.forceValue(a->second.value);
|
||||
if (a->second.value.type == tString)
|
||||
xmlAttrs["drvPath"] = drvPath = a->second.value.string.s;
|
||||
if (strict) state.forceValue(*a->second.value);
|
||||
if (a->second.value->type == tString)
|
||||
xmlAttrs["drvPath"] = drvPath = a->second.value->string.s;
|
||||
}
|
||||
|
||||
a = v.attrs->find(state.sOutPath);
|
||||
if (a != v.attrs->end()) {
|
||||
if (strict) state.forceValue(a->second.value);
|
||||
if (a->second.value.type == tString)
|
||||
xmlAttrs["outPath"] = a->second.value.string.s;
|
||||
if (strict) state.forceValue(*a->second.value);
|
||||
if (a->second.value->type == tString)
|
||||
xmlAttrs["outPath"] = a->second.value->string.s;
|
||||
}
|
||||
|
||||
XMLOpenElement _(doc, "derivation", xmlAttrs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue