fix haddock submodule pointer
[ghc-hetmet.git] / rts / sm / GC.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team 1998-2008
4  *
5  * Generational garbage collector
6  *
7  * Documentation on the architecture of the Garbage Collector can be
8  * found in the online commentary:
9  * 
10  *   http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
11  *
12  * ---------------------------------------------------------------------------*/
13
14 #ifndef SM_GC_H
15 #define SM_GC_H
16
17 #include "BeginPrivate.h"
18
19 void GarbageCollect(rtsBool force_major_gc, nat gc_type, Capability *cap);
20
21 typedef void (*evac_fn)(void *user, StgClosure **root);
22
23 StgClosure * isAlive      ( StgClosure *p );
24 void         markCAFs     ( evac_fn evac, void *user );
25
26 extern nat N;
27 extern rtsBool major_gc;
28
29 extern bdescr *mark_stack_bd;
30 extern bdescr *mark_stack_top_bd;
31 extern StgPtr mark_sp;
32
33 extern long copied;
34
35 extern rtsBool work_stealing;
36
37 #ifdef DEBUG
38 extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
39 #endif
40
41 #if defined(PROF_SPIN) && defined(THREADED_RTS)
42 extern StgWord64 whitehole_spin;
43 #endif
44
45 void gcWorkerThread (Capability *cap);
46 void initGcThreads (void);
47 void freeGcThreads (void);
48
49 #if defined(THREADED_RTS)
50 void waitForGcThreads (Capability *cap);
51 void releaseGCThreads (Capability *cap);
52 #endif
53
54 #define WORK_UNIT_WORDS 128
55
56 #include "EndPrivate.h"
57
58 #endif /* SM_GC_H */