diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 26f078c8..d5492f30 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -18,7 +18,7 @@ namespace nix { EvalState::EvalState() : sessionNormalForms(32768), normalForms(32768), primOps(128) { - nrEvaluated = nrCached = nrDephtAfterReset = 0; + nrEvaluated = nrCached = nrDepthAfterReset = 0; initNixExprHelpers(); @@ -815,7 +815,7 @@ Expr evalExpr(EvalState & state, Expr e) const unsigned int hugeEvalExpr = 100; unsigned int nrEvaluated = state.nrEvaluated++; - state.nrDephtAfterReset++; + state.nrDepthAfterReset++; /* Consult the memo table to quickly get the normal form of previously evaluated expressions. */ @@ -843,12 +843,12 @@ Expr evalExpr(EvalState & state, Expr e) } // session independent condition - if (state.nrDephtAfterReset && state.safeCache && + if (state.nrDepthAfterReset && state.safeCache && // heuristic condition state.nrEvaluated - nrEvaluated > hugeEvalExpr) { state.sessionNormalForms.remove(e); state.normalForms.set(e, nf); - state.nrDephtAfterReset--; + state.nrDepthAfterReset--; } else { state.sessionNormalForms.set(e, nf); } @@ -860,7 +860,7 @@ Expr evalExpr(EvalState & state, Expr e) Expr evalFile(EvalState & state, const Path & path) { startNest(nest, lvlTalkative, format("evaluating file `%1%'") % path); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; Expr e = parseExprFromFile(state, path); try { return evalExpr(state, e); diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 87f7d6fb..e4879fd8 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -38,7 +38,7 @@ struct EvalState unsigned int nrEvaluated; unsigned int nrCached; - unsigned int nrDephtAfterReset; + unsigned int nrDepthAfterReset; bool allowUnsafeEquality; bool safeCache; diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 223954f7..7fd1e119 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -74,14 +74,14 @@ static Expr prim_null(EvalState & state, const ATermVector & args) platforms. */ static Expr prim_currentSystem(EvalState & state, const ATermVector & args) { - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; return makeStr(thisSystem); } static Expr prim_currentTime(EvalState & state, const ATermVector & args) { - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; return ATmake("Int()", time(0)); } @@ -230,7 +230,7 @@ static Expr prim_addErrorContext(EvalState & state, const ATermVector & args) static Expr prim_getEnv(EvalState & state, const ATermVector & args) { string name = evalStringNoCtx(state, args[0]); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; return makeStr(getEnv(name)); } @@ -319,7 +319,7 @@ static Hash hashDerivationModulo(EvalState & state, Derivation drv) static Expr prim_derivationStrict(EvalState & state, const ATermVector & args) { startNest(nest, lvlVomit, "evaluating derivation"); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; ATermMap attrs; queryAllAttrs(evalExpr(state, args[0]), attrs, true); @@ -553,7 +553,7 @@ static Expr prim_storePath(EvalState & state, const ATermVector & args) { PathSet context; Path path = canonPath(coerceToPath(state, args[0], context)); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; if (!isInStore(path)) throw EvalError(format("path `%1%' is not in the Nix store") % path); Path path2 = toStorePath(path); @@ -570,7 +570,7 @@ static Expr prim_pathExists(EvalState & state, const ATermVector & args) Path path = coerceToPath(state, args[0], context); if (!context.empty()) throw EvalError(format("string `%1%' cannot refer to other paths") % path); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; return makeBool(pathExists(path)); } @@ -604,7 +604,7 @@ static Expr prim_readFile(EvalState & state, const ATermVector & args) Path path = coerceToPath(state, args[0], context); if (!context.empty()) throw EvalError(format("string `%1%' cannot refer to other paths") % path); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; return makeStr(readFile(path)); } @@ -644,7 +644,7 @@ static Expr prim_toFile(EvalState & state, const ATermVector & args) refs.insert(path); } - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; Path storePath = readOnlyMode ? computeStorePathForText(name, contents, refs) : store->addTextToStore(name, contents, refs); @@ -697,7 +697,7 @@ static Expr prim_filterSource(EvalState & state, const ATermVector & args) FilterFromExpr filter(state, args[0]); - state.nrDephtAfterReset = 0; + state.nrDepthAfterReset = 0; Path dstPath = readOnlyMode ? computeStorePathForPath(path, true, htSHA256, filter).first : store->addToStore(path, true, htSHA256, filter);