1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +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:
Eelco Dolstra 2010-10-22 14:47:42 +00:00
parent 64c3325b0b
commit 41c45a9b31
15 changed files with 150 additions and 130 deletions

View file

@ -122,7 +122,7 @@ struct Env
struct Attr
{
Value value;
Value * value;
Pos * pos;
Attr() : pos(&noPos) { };
};
@ -294,12 +294,15 @@ public:
/* Automatically call a function for which each argument has a
default value or has a binding in the `args' map. */
void autoCallFunction(const Bindings & args, Value & fun, Value & res);
void autoCallFunction(Bindings & args, Value & fun, Value & res);
/* Allocation primitives. */
Value * allocValue();
Value * allocValues(unsigned int count);
Env & allocEnv(unsigned int size);
Value * allocAttr(Value & vAttrs, const Symbol & name);
void mkList(Value & v, unsigned int length);
void mkAttrs(Value & v);
void mkThunk_(Value & v, Expr * expr);