From fa472794400745d896607f7ea33cd2a0adff4c71 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Mar 2015 16:24:54 +0100 Subject: Print some Boehm GC stats --- src/libexpr/eval.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 4ee0b793b..01f0be52d 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1515,6 +1515,13 @@ void EvalState::printStats() printMsg(v, format(" number of function calls: %1%") % nrFunctionCalls); printMsg(v, format(" total allocations: %1% bytes") % (bEnvs + bLists + bValues + bAttrsets)); +#if HAVE_BOEHMGC + GC_word heapSize, totalBytes; + GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes); + printMsg(v, format(" current Boehm heap size: %1% bytes") % heapSize); + printMsg(v, format(" total Boehm heap allocations: %1% bytes") % totalBytes); +#endif + if (countCalls) { v = lvlInfo; -- cgit v1.2.3