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;
35 extern rtsBool work_stealing;
38 extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
41 #if defined(PROF_SPIN) && defined(THREADED_RTS)
42 extern StgWord64 whitehole_spin;
45 void gcWorkerThread (Capability *cap);
46 void initGcThreads (void);
47 void freeGcThreads (void);
49 #if defined(THREADED_RTS)
50 void waitForGcThreads (Capability *cap);
51 void releaseGCThreads (Capability *cap);
54 #define WORK_UNIT_WORDS 128