about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2012-01-04T21·24+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2012-01-04T21·24+0000
commit35f2a6ba82419d48ed8ebce7b8c3e74e65ac74f2 (patch)
treeeae7ae96104e0d68de31efa9a31a9d75b8c05129 /src/libexpr/nixexpr.hh
parentadaf64a99b0a882249e35768c3f4fe3de104cbb2 (diff)
* Don't use dynamic_cast, it's very slow. "nix-instantiate
  /etc/nixos/nixos -A system" spent about 10% of its time in
  dynamic_cast.

Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 166289b29851..1c5cc07afe18 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -53,6 +53,7 @@ struct Expr
     virtual void show(std::ostream & str);
     virtual void bindVars(const StaticEnv & env);
     virtual void eval(EvalState & state, Env & env, Value & v);
+    virtual Value * maybeThunk(EvalState & state, Env & env);
 };
 
 std::ostream & operator << (std::ostream & str, Expr & e);
@@ -117,6 +118,7 @@ struct ExprVar : Expr
     VarRef info;
     ExprVar(const Symbol & name) : info(name) { };
     COMMON_METHODS
+    Value * maybeThunk(EvalState & state, Env & env);
 };
 
 struct ExprSelect : Expr