diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-10-22 14:47:42 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-10-22 14:47:42 +0000 |
commit | 41c45a9b319a5578e2731505ca3de2b9c50b4988 (patch) | |
tree | 8bc5da0b8bcb62393a7f143611d6627b03589400 /src/libexpr/nixexpr.cc | |
parent | 64c3325b0bef8c0234bf797033e129323b36ad1e (diff) |
* 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.
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r-- | src/libexpr/nixexpr.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index 898fdb609..9f2ea7883 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -213,10 +213,10 @@ void ExprAttrs::bindVars(const StaticEnv & env) unsigned int displ = 0; foreach (ExprAttrs::Attrs::iterator, i, attrs) - newEnv.vars[i->first] = displ++; + displs[i->first] = newEnv.vars[i->first] = displ++; foreach (list<Inherited>::iterator, i, inherited) { - newEnv.vars[i->first.name] = displ++; + displs[i->first.name] = newEnv.vars[i->first.name] = displ++; i->first.bind(env); } |