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