about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T14·20+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T14·20+0000
commit2dc6d5094183edee523a48d449eab1a376e839a2 (patch)
tree0a5268947074eff0be7428d891817d60a193c28f /src/libexpr/eval.hh
parent0b305c534f989dbc3645ff03e070b0e4665fdeb7 (diff)
* Don't create thunks for variable lookups (if possible). This
  significantly reduces the number of values allocated (e.g. from 8.7m
  to 4.9m for the Bittorrent test).

Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 2f1b3fa459..e1aa69dd38 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -169,14 +169,6 @@ static inline void mkBool(Value & v, bool b)
 }
 
 
-static inline void mkThunk(Value & v, Env & env, Expr * expr)
-{
-    v.type = tThunk;
-    v.thunk.env = &env;
-    v.thunk.expr = expr;
-}
-
-
 static inline void mkApp(Value & v, Value & left, Value & right)
 {
     v.type = tApp;
@@ -325,6 +317,8 @@ public:
     void mkList(Value & v, unsigned int length);
     void mkAttrs(Value & v);
     void mkThunk_(Value & v, Expr * expr);
+
+    Value * maybeThunk(Env & env, Expr * expr);
     
     void cloneAttrs(Value & src, Value & dst);