1 /* -----------------------------------------------------------------------------
3 * (c) The University of Glasgow, 2004
5 * Lag/Drag/Void profiling.
7 * ---------------------------------------------------------------------------*/
10 #define RTS_PROF_LDV_H
14 /* retrieves the LDV word from closure c */
15 #define LDVW(c) (((StgClosure *)(c))->header.prof.hp.ldvw)
18 * Stores the creation time for closure c.
19 * This macro is called at the very moment of closure creation.
21 * NOTE: this initializes LDVW(c) to zero, which ensures that there
22 * is no conflict between retainer profiling and LDV profiling,
23 * because retainer profiling also expects LDVW(c) to be initialised
29 #define LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(c) \
30 foreign "C" LDV_recordDead_FILL_SLOP_DYNAMIC(c "ptr")
34 #define LDV_RECORD_CREATE(c) \
35 LDVW((c)) = ((StgWord)RTS_DEREF(era) << LDV_SHIFT) | LDV_STATE_CREATE
37 void LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p );
39 #define LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(c) \
40 LDV_recordDead_FILL_SLOP_DYNAMIC(c)
44 #else /* !PROFILING */
46 #define LDV_RECORD_CREATE(c) /* nothing */
47 #define LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(c) /* nothing */
49 #endif /* PROFILING */
51 #endif /* STGLDVPROF_H */