-#ifdef PROFILING
-
-// Engine
-
-// declared in LdvProfile.c
-extern nat ldvTime;
-
-// LdvGenInfo stores the statistics for one specific census.
-typedef struct {
- double time; // the time in MUT time at the corresponding census is made
-
- // We employ int instead of nat, for some values may be negative temporarily,
- // e.g., dragNew.
-
- // computed at each census
- int inherentlyUsed; // total size of 'inherently used' closures
- int notUsed; // total size of 'never used' closures
- int used; // total size of 'used at least once' closures
-
- /*
- voidNew and dragNew are updated when a closure is destroyed.
- For instance, when a 'never used' closure of size s and creation time
- t is destroyed at time u, voidNew of eras t through u - 1 is increased
- by s.
- Likewise, when a 'used at least once' closure of size s and last use time
- t is destroyed at time u, dragNew of eras t + 1 through u - 1 is increase
- by s.
- In our implementation, voidNew and dragNew are computed indirectly: instead
- of updating voidNew or dragNew of all intervening eras, we update that
- of the end two eras (one is increased and the other is decreased).
- */
- int voidNew; // current total size of 'destroyed without being used' closures
- int dragNew; // current total size of 'used at least once and waiting to die'
- // closures
-
- // computed post-mortem
- int voidTotal; // total size of closures in 'void' state
- // lagTotal == notUsed - voidTotal // in 'lag' state
- int dragTotal; // total size of closures in 'drag' state
- // useTotal == used - dragTotal // in 'use' state
-} LdvGenInfo;
-
-extern LdvGenInfo *gi;
-
-// retrieves the LDV word from closure c
-#define LDVW(c) (((StgClosure *)(c))->header.prof.hp.ldvw)
-