diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-09-03 12:56:33 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-09-03 13:01:42 +0200 |
commit | 6f809194d7448c4ad50174bed9ba2419e2114352 (patch) | |
tree | 03e493977baf95671cb652b197772376c68fe130 /src/libexpr/primops.cc | |
parent | 57d18df7d0005cf822368d9f1d0c33396c6b9f9f (diff) |
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.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index bcaa51dd6..a216fa7ab 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -82,8 +82,7 @@ static void prim_import(EvalState & state, Value * * args, Value & v) } w.attrs->sort(); Value fun; - state.mkThunk_(fun, - state.parseExprFromFile(state.findFile("nix/imported-drv-to-derivation.nix"))); + state.evalFile(state.findFile("nix/imported-drv-to-derivation.nix"), fun); state.forceFunction(fun); mkApp(v, fun, w); state.forceAttrs(v); @@ -1263,7 +1262,7 @@ void EvalState::createBaseEnv() /* Add a wrapper around the derivation primop that computes the `drvPath' and `outPath' attributes lazily. */ - mkThunk_(v, parseExprFromFile(findFile("nix/derivation.nix"))); + evalFile(findFile("nix/derivation.nix"), v); addConstant("derivation", v); /* Now that we've added all primops, sort the `builtins' attribute |