Fix typo.

This commit is contained in:
Nicolas Pierron 2009-07-08 09:44:22 +00:00
parent 9416202465
commit 6468f63994
3 changed files with 15 additions and 15 deletions

View File

@ -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);

View File

@ -38,7 +38,7 @@ struct EvalState
unsigned int nrEvaluated;
unsigned int nrCached;
unsigned int nrDephtAfterReset;
unsigned int nrDepthAfterReset;
bool allowUnsafeEquality;
bool safeCache;

View File

@ -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(<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);