about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-31T10·44+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-31T10·44+0200
commit0a470fc3453f56a0a242d8f467b8079fe0040ff7 (patch)
treefeb889a3540586cb4247fcd8ca017bdd8d1b71dc /src/libexpr/eval.hh
parent8ae6d55db15bb0777e3d707afb994f6fcbcc6a65 (diff)
Make Env smaller
Commit 20866a7031ca823055a221653b77986faa167329 added a ‘withAttrs’
field to Env, which is annoying because it makes every Env structure
bigger and we allocate millions of them.  E.g. NixOS evaluation took
18 MiB more.  So this commit squeezes ‘withAttrs’ into values[0].
Probably should use a union...
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index c820b28f49ae..6f6b2a9009fe 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -52,8 +52,8 @@ struct PrimOp
 struct Env
 {
     Env * up;
-    unsigned int prevWith; // nr of levels up to next `with' environment
-    Expr * withAttrs;
+    unsigned short prevWith; // nr of levels up to next `with' environment
+    bool haveWithAttrs;
     Value * values[0];
 };