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

* Environment variable to disable normal form caching.

This commit is contained in:
Eelco Dolstra 2007-10-11 12:09:06 +00:00
parent b57f8bd38d
commit 8e0488370d
2 changed files with 6 additions and 0 deletions

View file

@ -23,6 +23,8 @@ EvalState::EvalState()
initNixExprHelpers(); initNixExprHelpers();
addPrimOps(); addPrimOps();
cacheTerms = getEnv("NIX_TERM_CACHE", "1") == "1";
} }
@ -730,6 +732,8 @@ Expr evalExpr(EvalState & state, Expr e)
state.nrEvaluated++; state.nrEvaluated++;
if (!state.cacheTerms) return evalExpr2(state, e);
/* Consult the memo table to quickly get the normal form of /* Consult the memo table to quickly get the normal form of
previously evaluated expressions. */ previously evaluated expressions. */
Expr nf = state.normalForms.get(e); Expr nf = state.normalForms.get(e);

View file

@ -38,6 +38,8 @@ struct EvalState
unsigned int nrEvaluated; unsigned int nrEvaluated;
unsigned int nrCached; unsigned int nrCached;
bool cacheTerms;
EvalState(); EvalState();
void addPrimOps(); void addPrimOps();