1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-26 04:00:59 +01:00

* Some hacks to simulate conventional laziness.

This commit is contained in:
Eelco Dolstra 2007-10-11 21:58:37 +00:00
parent cd9d10d4e3
commit 981afe821c
7 changed files with 47 additions and 10 deletions

View file

@ -2,6 +2,7 @@
#include "derivations.hh"
#include "util.hh"
#include "aterm.hh"
#include "eval.hh" // !!! urgh
#include "nixexpr-ast.hh"
#include "nixexpr-ast.cc"
@ -399,5 +400,18 @@ string showValue(Expr e)
return "<unknown>";
}
static unsigned int cellCount = 0;
Expr allocCell(Expr e)
{
if (cacheTerms != 2) return e;
int i;
Expr e2;
if (matchCell(e, i, e2)) return e;
return makeCell(cellCount++, e);
}
}