about summary refs log tree commit diff
path: root/src/libexpr/value.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/value.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/value.hh')
-rw-r--r--src/libexpr/value.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh
index 2feb2f9492..227f5e1730 100644
--- a/src/libexpr/value.hh
+++ b/src/libexpr/value.hh
@@ -159,4 +159,10 @@ static inline void mkPathNoCopy(Value & v, const char * s)
 void mkPath(Value & v, const char * s);
 
 
+/* Compute the size in bytes of the given value, including all values
+   and environments reachable from it. Static expressions (Exprs) are
+   not included. */
+size_t valueSize(Value & v);
+
+
 }