X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FProfHeap.c;h=e93151d4f44dd930b9fd4067c33157268b3535eb;hb=e576ba5d31fbae54c43e88316fb0dbdba9cbd4ff;hp=4aecd0b5b3fcc6b9b92db05c4a3f290a686eba33;hpb=1cb0eb071f1316d6650f354166506789a2638720;p=ghc-hetmet.git diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 4aecd0b..e93151d 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -316,6 +316,13 @@ initEra(Census *census) census->drag_total = 0; } +STATIC_INLINE void +freeEra(Census *census) +{ + arenaFree(census->arena); + freeHashTable(census->hash, NULL); +} + /* -------------------------------------------------------------------------- * Increases era by 1 and initialize census[era]. * Reallocates gi[] and increases its size if needed. @@ -355,6 +362,10 @@ void initProfiling1( void ) { } +void freeProfiling1( void ) +{ +} + void initProfiling2( void ) { if (RtsFlags.ProfFlags.doHeapProfile) { @@ -493,6 +504,14 @@ endHeapProfiling(void) } #endif + { + nat t; + for (t = 0; t <= era; t++) { + freeEra( &censuses[t] ); + } + } + stgFree(censuses); + seconds = mut_user_time(); printSample(rtsTrue, seconds); printSample(rtsFalse, seconds);