mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
* Don't create thunks for variable lookups (if possible). This
significantly reduces the number of values allocated (e.g. from 8.7m to 4.9m for the Bittorrent test).
This commit is contained in:
parent
0b305c534f
commit
2dc6d50941
3 changed files with 60 additions and 23 deletions
|
@ -169,14 +169,6 @@ static inline void mkBool(Value & v, bool b)
|
|||
}
|
||||
|
||||
|
||||
static inline void mkThunk(Value & v, Env & env, Expr * expr)
|
||||
{
|
||||
v.type = tThunk;
|
||||
v.thunk.env = &env;
|
||||
v.thunk.expr = expr;
|
||||
}
|
||||
|
||||
|
||||
static inline void mkApp(Value & v, Value & left, Value & right)
|
||||
{
|
||||
v.type = tApp;
|
||||
|
@ -325,6 +317,8 @@ public:
|
|||
void mkList(Value & v, unsigned int length);
|
||||
void mkAttrs(Value & v);
|
||||
void mkThunk_(Value & v, Expr * expr);
|
||||
|
||||
Value * maybeThunk(Env & env, Expr * expr);
|
||||
|
||||
void cloneAttrs(Value & src, Value & dst);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue