From 2dc6d5094183edee523a48d449eab1a376e839a2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Oct 2010 14:20:02 +0000 Subject: * 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). --- src/libexpr/eval.hh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/libexpr/eval.hh') diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 2f1b3fa45..e1aa69dd3 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); -- cgit v1.2.3