mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* In environments, store pointers to values rather than values. This
improves GC effectiveness a bit more (because a live value doesn't keep other values in the environment plus the parent environments alive), and removes the need for copy nodes.
This commit is contained in:
parent
cf7e645a48
commit
4dee289550
2 changed files with 25 additions and 35 deletions
|
@ -38,7 +38,6 @@ typedef enum {
|
|||
tThunk,
|
||||
tApp,
|
||||
tLambda,
|
||||
tCopy,
|
||||
tBlackhole,
|
||||
tPrimOp,
|
||||
tPrimOpApp,
|
||||
|
@ -116,7 +115,7 @@ struct Env
|
|||
{
|
||||
Env * up;
|
||||
unsigned int prevWith; // nr of levels up to next `with' environment
|
||||
Value values[0];
|
||||
Value * values[0];
|
||||
};
|
||||
|
||||
|
||||
|
@ -150,13 +149,6 @@ static inline void mkThunk(Value & v, Env & env, Expr * expr)
|
|||
}
|
||||
|
||||
|
||||
static inline void mkCopy(Value & v, Value & src)
|
||||
{
|
||||
v.type = tCopy;
|
||||
v.val = &src;
|
||||
}
|
||||
|
||||
|
||||
static inline void mkApp(Value & v, Value & left, Value & right)
|
||||
{
|
||||
v.type = tApp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue