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:
parent
b57f8bd38d
commit
8e0488370d
2 changed files with 6 additions and 0 deletions
|
|
@ -23,6 +23,8 @@ EvalState::EvalState()
|
|||
initNixExprHelpers();
|
||||
|
||||
addPrimOps();
|
||||
|
||||
cacheTerms = getEnv("NIX_TERM_CACHE", "1") == "1";
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -730,6 +732,8 @@ Expr evalExpr(EvalState & state, Expr e)
|
|||
|
||||
state.nrEvaluated++;
|
||||
|
||||
if (!state.cacheTerms) return evalExpr2(state, e);
|
||||
|
||||
/* Consult the memo table to quickly get the normal form of
|
||||
previously evaluated expressions. */
|
||||
Expr nf = state.normalForms.get(e);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ struct EvalState
|
|||
unsigned int nrEvaluated;
|
||||
unsigned int nrCached;
|
||||
|
||||
bool cacheTerms;
|
||||
|
||||
EvalState();
|
||||
|
||||
void addPrimOps();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue