X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FGC.c;h=0d2ba85860fd36a996af6e69dceff1a820c8e84f;hb=06f9b7c365fb9e9b53723f892b4d63b4f7a56e9a;hp=6510e777983218214fd5366c8fa71e07ded08db6;hpb=d07d5ed880e6f4529c2331a5d5a963505d884dd9;p=ghc-hetmet.git diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 6510e77..0d2ba85 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -207,16 +207,11 @@ GarbageCollect ( rtsBool force_major_gc ) } #endif - // tell the STM to discard any cached closures it's hoping to re-use - stmPreGCHook(); - // tell the stats department that we've started a GC stat_startGC(); -#ifdef DEBUG - // check for memory leaks if DEBUG is on - memInventory(); -#endif + // tell the STM to discard any cached closures it's hoping to re-use + stmPreGCHook(); #ifdef DEBUG mutlist_MUTVARS = 0; @@ -266,6 +261,11 @@ GarbageCollect ( rtsBool force_major_gc ) } #endif +#ifdef DEBUG + // check for memory leaks if DEBUG is on + memInventory(traceClass(DEBUG_gc)); +#endif + // check stack sanity *before* GC (ToDo: check all threads) IF_DEBUG(sanity, checkFreeListSanity()); @@ -667,7 +667,7 @@ GarbageCollect ( rtsBool force_major_gc ) #ifdef DEBUG // check for memory leaks if DEBUG is on - memInventory(); + memInventory(traceClass(DEBUG_gc)); #endif #ifdef RTS_GTK_FRONTPANEL