1 /* -----------------------------------------------------------------------------
2 * $Id: RetainerProfile.h,v 1.2 2001/11/26 16:54:21 simonmar Exp $
4 * (c) The GHC Team, 2001
7 * Retainer profiling interface.
9 * ---------------------------------------------------------------------------*/
11 #ifndef RETAINERPROFILE_H
12 #define RETAINERPROFILE_H
16 #include "RetainerSet.h"
18 extern void initRetainerProfiling ( void );
19 extern void endRetainerProfiling ( void );
20 extern void printRetainer ( FILE *, retainer );
21 extern void retainerProfile ( void );
22 extern void resetStaticObjectForRetainerProfiling ( void );
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 // firstStack is exported because memInventory() in Schedule.c uses it.
43 extern bdescr *firstStack;
46 #endif /* PROFILING */
48 #endif /* RETAINERPROFILE_H */