1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 2001
6 * Retainer profiling interface.
8 * ---------------------------------------------------------------------------*/
10 #ifndef RETAINERPROFILE_H
11 #define RETAINERPROFILE_H
15 #include "RetainerSet.h"
19 void initRetainerProfiling ( void );
20 void endRetainerProfiling ( void );
21 void retainerProfile ( void );
22 void resetStaticObjectForRetainerProfiling( StgClosure *static_objects );
26 // extract the retainer set field from c
27 #define RSET(c) ((c)->header.prof.hp.rs)
29 #define isRetainerSetFieldValid(c) \
30 ((((StgWord)(c)->header.prof.hp.rs & 1) ^ flip) == 0)
32 static inline RetainerSet *
33 retainerSetOf( StgClosure *c )
35 ASSERT( isRetainerSetFieldValid(c) );
36 // StgWord has the same size as pointers, so the following type
38 return (RetainerSet *)((StgWord)RSET(c) ^ flip);
41 // Used by Storage.c:memInventory()
43 extern lnat retainerStackBlocks ( void );
48 #endif /* PROFILING */
50 #endif /* RETAINERPROFILE_H */