Strip parentheses in expressions contexts in error messages
[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 * https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/gc
11 *
12 * ---------------------------------------------------------------------------*/
13
14 #pragma once
15
16 #include "BeginPrivate.h"
17
18 #include "HeapAlloc.h"
19
20 void GarbageCollect (uint32_t collect_gen,
21 bool do_heap_census,
22 bool deadlock_detect,
23 uint32_t gc_type,
24 Capability *cap,
25 bool idle_cap[]);
26
27 typedef void (*evac_fn)(void *user, StgClosure **root);
28
29 StgClosure * isAlive ( StgClosure *p );
30 void markCAFs ( evac_fn evac, void *user );
31
32 bool doIdleGCWork(Capability *cap, bool all);
33
34 extern uint32_t N;
35 extern bool major_gc;
36 /* See Note [Deadlock detection under nonmoving collector]. */
37 extern bool deadlock_detect_gc;
38
39 extern bdescr *mark_stack_bd;
40 extern bdescr *mark_stack_top_bd;
41 extern StgPtr mark_sp;
42
43 extern bool work_stealing;
44
45 #if defined(DEBUG)
46 extern uint32_t mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS,
47 mutlist_TVAR,
48 mutlist_TVAR_WATCH_QUEUE,
49 mutlist_TREC_CHUNK,
50 mutlist_TREC_HEADER;
51 #endif
52
53 #if defined(PROF_SPIN) && defined(THREADED_RTS)
54 extern volatile StgWord64 whitehole_gc_spin;
55 extern volatile StgWord64 waitForGcThreads_spin;
56 extern volatile StgWord64 waitForGcThreads_yield;
57 #endif
58
59 void gcWorkerThread (Capability *cap);
60 void initGcThreads (uint32_t from, uint32_t to);
61 void freeGcThreads (void);
62
63 void resizeGenerations (void);
64
65 #if defined(THREADED_RTS)
66 void waitForGcThreads (Capability *cap, bool idle_cap[]);
67 void releaseGCThreads (Capability *cap, bool idle_cap[]);
68 #endif
69
70 #define WORK_UNIT_WORDS 128
71
72 #include "EndPrivate.h"