remove empty dir
[ghc-hetmet.git] / rts / RetainerProfile.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 2001
4  * Author: Sungwoo Park
5  *
6  * Retainer profiling interface.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 #ifndef RETAINERPROFILE_H
11 #define RETAINERPROFILE_H
12
13 #ifdef PROFILING
14
15 #include "RetainerSet.h"
16
17 extern void  initRetainerProfiling ( void );
18 extern void  endRetainerProfiling  ( void );
19 extern void  printRetainer         ( FILE *, retainer );
20 extern void  retainerProfile       ( void );
21 extern void  resetStaticObjectForRetainerProfiling ( void );
22
23 extern StgWord RTS_VAR(flip);
24
25 // extract the retainer set field from c
26 #define RSET(c)   ((c)->header.prof.hp.rs)
27
28 #define isRetainerSetFieldValid(c) \
29   ((((StgWord)(c)->header.prof.hp.rs & 1) ^ flip) == 0)
30
31 static inline RetainerSet *
32 retainerSetOf( StgClosure *c )
33 {
34     ASSERT( isRetainerSetFieldValid(c) );
35     // StgWord has the same size as pointers, so the following type
36     // casting is okay.
37     return (RetainerSet *)((StgWord)RSET(c) ^ flip);
38 }
39
40 // Used by Storage.c:memInventory()
41 #ifdef DEBUG
42 extern lnat retainerStackBlocks ( void );
43 #endif
44
45 #endif /* PROFILING */
46
47 #endif /* RETAINERPROFILE_H */