1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team 1998-2008
5 * Generational garbage collector
7 * Documentation on the architecture of the Garbage Collector can be
8 * found in the online commentary:
10 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
12 * ---------------------------------------------------------------------------*/
17 void GarbageCollect(rtsBool force_major_gc, nat gc_type, Capability *cap);
19 typedef void (*evac_fn)(void *user, StgClosure **root);
21 StgClosure * isAlive ( StgClosure *p );
22 void markCAFs ( evac_fn evac, void *user );
25 extern rtsBool major_gc;
27 extern bdescr *mark_stack_bdescr;
28 extern StgPtr *mark_stack;
29 extern StgPtr *mark_sp;
30 extern StgPtr *mark_splim;
32 extern rtsBool mark_stack_overflowed;
33 extern bdescr *oldgen_scan_bd;
34 extern StgPtr oldgen_scan;
38 extern rtsBool work_stealing;
41 extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
44 #if defined(PROF_SPIN) && defined(THREADED_RTS)
45 extern StgWord64 whitehole_spin;
48 void gcWorkerThread (Capability *cap);
49 void initGcThreads (void);
50 void freeGcThreads (void);
52 #if defined(THREADED_RTS)
53 void waitForGcThreads (Capability *cap);
54 void releaseGCThreads (Capability *cap);
57 #define WORK_UNIT_WORDS 128