From 7bdb85453d16106ebf4d4af106720d917e221ad9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Oct 2013 15:34:57 +0200 Subject: printStats(): Print the size of the symbol table in bytes --- src/libexpr/nixexpr.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libexpr/nixexpr.cc') diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index 28049bb0d6..2e26d50817 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; +} + + } -- cgit 1.4.1