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 * ---------------------------------------------------------------------------*/
19 void GarbageCollect(rtsBool force_major_gc, nat gc_type, Capability *cap);
21 typedef void (*evac_fn)(void *user, StgClosure **root);
23 StgClosure * isAlive ( StgClosure *p );
24 void markCAFs ( evac_fn evac, void *user );
27 extern rtsBool major_gc;
29 extern bdescr *mark_stack_bd;
30 extern bdescr *mark_stack_top_bd;
31 extern StgPtr mark_sp;
32 extern StgPtr mark_splim;
36 extern rtsBool work_stealing;
39 extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
42 #if defined(PROF_SPIN) && defined(THREADED_RTS)
43 extern StgWord64 whitehole_spin;
46 void gcWorkerThread (Capability *cap);
47 void initGcThreads (void);
48 void freeGcThreads (void);
50 #if defined(THREADED_RTS)
51 void waitForGcThreads (Capability *cap);
52 void releaseGCThreads (Capability *cap);
55 #define WORK_UNIT_WORDS 128