FIX #2164: check for ThreadRelocated in isAlive()
[ghc.git] / rts / Sanity.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-1999
4 *
5 * Prototypes for functions in Sanity.c
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef SANITY_H
10
11 #ifdef DEBUG
12
13 # if defined(PAR)
14 # define PVM_PE_MASK 0xfffc0000
15 # define MAX_PVM_PES MAX_PES
16 # define MAX_PVM_TIDS MAX_PES
17 # define MAX_SLOTS 100000
18 # endif
19
20 /* debugging routines */
21 extern void checkHeap ( bdescr *bd );
22 extern void checkHeapChunk ( StgPtr start, StgPtr end );
23 extern void checkChain ( bdescr *bd );
24 extern void checkTSO ( StgTSO* tso );
25 extern void checkGlobalTSOList ( rtsBool checkTSOs );
26 extern void checkStaticObjects ( StgClosure* static_objects );
27 extern void checkStackChunk ( StgPtr sp, StgPtr stack_end );
28 extern StgOffset checkStackFrame ( StgPtr sp );
29 extern StgOffset checkClosure ( StgClosure* p );
30
31 extern void checkMutableList ( bdescr *bd, nat gen );
32
33 #if defined(GRAN)
34 extern void checkTSOsSanity(void);
35 extern rtsBool checkThreadQSanity (PEs proc, rtsBool check_TSO_too);
36 extern rtsBool checkThreadQsSanity (rtsBool check_TSO_too);
37 #endif
38
39 #if defined(PAR)
40 extern void checkBQ (StgBlockingQueueElement *bqe, StgClosure *closure);
41 #else
42 extern void checkBQ (StgTSO *bqe, StgClosure *closure);
43 #endif
44
45 #if defined(PAR)
46 extern void checkLAGAtable(rtsBool check_closures);
47 extern void checkHeapChunk(StgPtr start, StgPtr end);
48 #endif
49
50 /* test whether an object is already on update list */
51 extern rtsBool isBlackhole( StgTSO* tso, StgClosure* p );
52
53 #endif /* DEBUG */
54
55 #endif /* SANITY_H */
56