summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
Diffstat (limited to 'rts')
-rw-r--r--rts/ProfHeap.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index f094038235..6d78886e39 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -262,12 +262,8 @@ initEra(Census *census)
STATIC_INLINE void
freeEra(Census *census)
{
- if (RtsFlags.ProfFlags.bioSelector != NULL)
- // when bioSelector==NULL, these are freed in heapCensus()
- {
- arenaFree(census->arena);
- freeHashTable(census->hash, NULL);
- }
+ arenaFree(census->arena);
+ freeHashTable(census->hash, NULL);
}
/* --------------------------------------------------------------------------
@@ -467,8 +463,12 @@ endHeapProfiling(void)
#ifdef PROFILING
if (doingLDVProfiling()) {
nat t;
- for (t = 1; t <= era; t++) {
- freeEra( &censuses[t] );
+ if (RtsFlags.ProfFlags.bioSelector != NULL) {
+ for (t = 1; t <= era; t++) {
+ freeEra( &censuses[t] );
+ }
+ } else {
+ freeEra( &censuses[era] );
}
} else {
freeEra( &censuses[0] );
@@ -1125,8 +1125,7 @@ void heapCensus (Time t)
#ifdef PROFILING
if (RtsFlags.ProfFlags.bioSelector == NULL)
{
- freeHashTable( census->hash, NULL/* don't free the elements */ );
- arenaFree( census->arena );
+ freeEra(census);
census->hash = NULL;
census->arena = NULL;
}