diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-09-22T12·46+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-09-22T14·05+0200 |
commit | eff120d1b93b99d6ae61b20e18c31a5324a2be4f (patch) | |
tree | eebd5bbbc0d36b50fcd3c8e74f2340937fd77116 /src/libexpr/value.hh | |
parent | 68cf98c4d20da7175e7e2fecdb4c89bc7cd3f643 (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.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh index 2feb2f9492ca..227f5e173084 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); + + } |