about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-09-22T12·46+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-09-22T14·05+0200
commiteff120d1b93b99d6ae61b20e18c31a5324a2be4f (patch)
treeeebd5bbbc0d36b50fcd3c8e74f2340937fd77116 /src/libexpr/eval.hh
parent68cf98c4d20da7175e7e2fecdb4c89bc7cd3f643 (diff)
Add a function ‘valueSize’
It returns the size of value, including all other values and
environments reachable from it. It is intended for debugging memory
consumption issues.
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index dcd6209e306c..d8ea0f0ce70e 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -95,8 +95,9 @@ struct PrimOp
 struct Env
 {
     Env * up;
-    unsigned short prevWith; // nr of levels up to next `with' environment
-    bool haveWithAttrs;
+    unsigned short size; // used by ‘valueSize’
+    unsigned short prevWith:15; // nr of levels up to next `with' environment
+    unsigned short haveWithAttrs:1;
     Value * values[0];
 };