1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

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.
This commit is contained in:
Eelco Dolstra 2014-09-22 14:46:42 +02:00
parent 68cf98c4d2
commit eff120d1b9
4 changed files with 99 additions and 2 deletions

View file

@ -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];
};