Prefer #if defined to #ifdef
[ghc.git] / rts / sm / Sanity.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-1999
4 *
5 * Prototypes for functions in Sanity.c
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #pragma once
10
11 #if defined(DEBUG)
12
13 #include "BeginPrivate.h"
14
15 # if defined(PAR)
16 # define PVM_PE_MASK 0xfffc0000
17 # define MAX_PVM_PES MAX_PES
18 # define MAX_PVM_TIDS MAX_PES
19 # define MAX_SLOTS 100000
20 # endif
21
22 /* debugging routines */
23 void checkSanity ( bool after_gc, bool major_gc );
24 void checkNurserySanity ( nursery *nursery );
25 void checkHeapChain ( bdescr *bd );
26 void checkHeapChunk ( StgPtr start, StgPtr end );
27 void checkLargeObjects ( bdescr *bd );
28 void checkTSO ( StgTSO* tso );
29 void checkGlobalTSOList ( bool checkTSOs );
30 void checkStaticObjects ( StgClosure* static_objects );
31 void checkStackChunk ( StgPtr sp, StgPtr stack_end );
32 StgOffset checkStackFrame ( StgPtr sp );
33 StgOffset checkClosure ( const StgClosure* p );
34
35 void checkRunQueue (Capability *cap);
36
37 void memInventory (bool show);
38
39 void checkBQ (StgTSO *bqe, StgClosure *closure);
40
41 #include "EndPrivate.h"
42
43 #endif /* DEBUG */