free the gc_thread structures during shutdown
[ghc.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 GC_H
15 #define GC_H
16
17 extern nat N;
18 extern rtsBool major_gc;
19
20 extern bdescr *mark_stack_bdescr;
21 extern StgPtr *mark_stack;
22 extern StgPtr *mark_sp;
23 extern StgPtr *mark_splim;
24
25 extern rtsBool mark_stack_overflowed;
26 extern bdescr *oldgen_scan_bd;
27 extern StgPtr oldgen_scan;
28
29 extern long copied;
30
31 extern rtsBool work_stealing;
32
33 #ifdef DEBUG
34 extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
35 #endif
36
37 #ifdef THREADED_RTS
38 extern SpinLock gc_alloc_block_sync;
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 void waitForGcThreads (Capability *cap);
49 void releaseGCThreads (Capability *cap);
50
51 #define WORK_UNIT_WORDS 128
52
53 #endif /* GC_H */