diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-08T13·34+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-08T13·37+0200 |
commit | 7bdb85453d16106ebf4d4af106720d917e221ad9 (patch) | |
tree | d8d9b37d490f85a3757af149c8851ad9ac00015b /src/libexpr/nixexpr.cc | |
parent | 9deb822180fb80638559fe3c45c6a77a2b56ff40 (diff) |
printStats(): Print the size of the symbol table in bytes
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r-- | src/libexpr/nixexpr.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index 28049bb0d638..2e26d50817fb 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -336,4 +336,16 @@ string ExprLambda::showNamePos() } + +/* Symbol table. */ + +size_t SymbolTable::totalSize() const +{ + size_t n = 0; + foreach (Symbols::const_iterator, i, symbols) + n += i->size(); + return n; +} + + } |