From 6f809194d7448c4ad50174bed9ba2419e2114352 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 3 Sep 2013 12:56:33 +0200 Subject: Get rid of the parse tree cache Since we already cache files in normal form (fileEvalCache), caching parse trees is redundant. Note that getting rid of this cache doesn't actually save much memory at the moment, because parse trees are currently not freed / GC'ed. --- src/nix-env/nix-env.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nix-env/nix-env.cc') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 9ed3eccf39a3..1cb1ec483339 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -131,7 +131,7 @@ static void getAllExprs(EvalState & state, if (hasSuffix(attrName, ".nix")) attrName = string(attrName, 0, attrName.size() - 4); attrs.attrs[state.symbols.create(attrName)] = - ExprAttrs::AttrDef(state.parseExprFromFile(absPath(path2)), noPos); + ExprAttrs::AttrDef(state.parseExprFromFile(resolveExprPath(absPath(path2))), noPos); } else /* `path2' is a directory (with no default.nix in it); @@ -143,7 +143,7 @@ static void getAllExprs(EvalState & state, static Expr * loadSourceExpr(EvalState & state, const Path & path) { - if (isNixExpr(path)) return state.parseExprFromFile(absPath(path)); + if (isNixExpr(path)) return state.parseExprFromFile(resolveExprPath(absPath(path))); /* The path is a directory. Put the Nix expressions in the directory in an attribute set, with the file name of each -- cgit 1.4.1