X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FGC.c;h=270784e45703a463304d1f83867f086e540817f4;hb=8b08c15b8ace5a76e341939081fbb6ad2736ddd1;hp=c181940ccf001dc5976d4a1bc58fe5477da204ab;hpb=ab0e778ccfde61aed4c22679b24d175fc6cc9bf3;p=ghc-hetmet.git diff --git a/rts/sm/GC.c b/rts/sm/GC.c index c181940..270784e 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -1,9 +1,14 @@ /* ----------------------------------------------------------------------------- * - * (c) The GHC Team 1998-2003 + * (c) The GHC Team 1998-2006 * * Generational garbage collector * + * Documentation on the architecture of the Garbage Collector can be + * found in the online commentary: + * + * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC + * * ---------------------------------------------------------------------------*/ #include "PosixSource.h" @@ -12,8 +17,6 @@ #include "RtsUtils.h" #include "Apply.h" #include "OSThreads.h" -#include "Storage.h" -#include "Stable.h" #include "LdvProfile.h" #include "Updates.h" #include "Stats.h" @@ -28,15 +31,6 @@ #include "ParTicky.h" // ToDo: move into Rts.h #include "RtsSignals.h" #include "STM.h" -#if defined(GRAN) || defined(PAR) -# include "GranSimRts.h" -# include "ParallelRts.h" -# include "FetchMe.h" -# if defined(DEBUG) -# include "Printer.h" -# include "ParallelDebug.h" -# endif -#endif #include "HsFFI.h" #include "Linker.h" #if defined(RTS_GTK_FRONTPANEL) @@ -235,9 +229,6 @@ GarbageCollect ( rtsBool force_major_gc ) mutlist_OTHERS = 0; #endif - // Init stats and print par specific (timing) info - PAR_TICKY_PAR_START(); - // attribute any costs to CCS_GC #ifdef PROFILING prev_CCS = CCCS; @@ -273,9 +264,6 @@ GarbageCollect ( rtsBool force_major_gc ) #endif // check stack sanity *before* GC (ToDo: check all threads) -#if defined(GRAN) - // ToDo!: check sanity IF_DEBUG(sanity, checkTSOsSanity()); -#endif IF_DEBUG(sanity, checkFreeListSanity()); /* Initialise the static object lists @@ -466,7 +454,6 @@ GarbageCollect ( rtsBool force_major_gc ) } for (g = RtsFlags.GcFlags.generations-1; g > N; g--) { - IF_PAR_DEBUG(verbose, printMutableList(&generations[g])); scavenge_mutable_list(&generations[g]); evac_gen = g; for (st = generations[g].n_steps-1; st >= 0; st--) { @@ -485,21 +472,6 @@ GarbageCollect ( rtsBool force_major_gc ) evac_gen = 0; GetRoots(mark_root); -#if defined(PAR) - /* And don't forget to mark the TSO if we got here direct from - * Haskell! */ - /* Not needed in a seq version? - if (CurrentTSO) { - CurrentTSO = (StgTSO *)MarkRoot((StgClosure *)CurrentTSO); - } - */ - - // Mark the entries in the GALA table of the parallel system - markLocalGAs(major_gc); - // Mark all entries on the list of pending fetches - markPendingFetches(major_gc); -#endif - /* Mark the weak pointer list, and prepare to detect dead weak * pointers. */ @@ -510,10 +482,6 @@ GarbageCollect ( rtsBool force_major_gc ) */ markStablePtrTable(mark_root); - /* Mark the root pointer table. - */ - markRootPtrTable(mark_root); - /* ------------------------------------------------------------------------- * Repeatedly scavenge all the areas we know about until there's no * more scavenging to be done. @@ -614,12 +582,6 @@ GarbageCollect ( rtsBool force_major_gc ) } } -#if defined(PAR) - // Reconstruct the Global Address tables used in GUM - rebuildGAtables(major_gc); - IF_DEBUG(sanity, checkLAGAtable(rtsTrue/*check closures, too*/)); -#endif - // Now see which stable names are still alive. gcStablePtrTable(); @@ -687,7 +649,7 @@ GarbageCollect ( rtsBool force_major_gc ) if (g <= N) { copied -= stp->hp_bd->start + BLOCK_SIZE_W - stp->hp_bd->free; - scavd_copied -= (P_)(BLOCK_ROUND_UP(stp->scavd_hp)) - stp->scavd_hp; + scavd_copied -= stp->scavd_hpLim - stp->scavd_hp; } } @@ -1057,8 +1019,6 @@ GarbageCollect ( rtsBool force_major_gc ) #endif RELEASE_SM_LOCK; - - //PAR_TICKY_TP(); } /* -----------------------------------------------------------------------------