106e0e29452ec11c6d2d3ac3dbfa3034b15e59d7
[ghc-hetmet.git] / ghc / rts / LdvProfile.h
1 /* -----------------------------------------------------------------------------
2  * $Id: LdvProfile.h,v 1.2 2001/11/26 16:54:21 simonmar Exp $
3  *
4  * (c) The GHC Team, 2001
5  * Author: Sungwoo Park
6  *
7  * Lag/Drag/Void profiling.
8  *
9  * ---------------------------------------------------------------------------*/
10
11 #ifndef LDVPROFILE_H
12 #define LDVPROFILE_H
13
14 #ifdef PROFILING
15
16 #include "ProfHeap.h"
17
18 extern void LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p );
19 extern void LdvCensusForDead ( nat );
20 extern void LdvCensusKillAll ( void );
21
22 // Creates a 0-filled slop of size 'howManyBackwards' backwards from the
23 // address 'from'. 
24 //
25 // Invoked when: 
26 //   1) Hp is incremented and exceeds HpLim (in Updates.hc).
27 //   2) copypart() is called (in GC.c).
28 #define FILL_SLOP(from, howManyBackwards)       \
29   if (era > 0) {                                \
30     int i;                                      \
31     for (i = 0;i < (howManyBackwards); i++)     \
32       ((StgWord *)(from))[-i] = 0;              \
33   }
34
35 // Informs the LDV profiler that closure c has just been evacuated.
36 // Evacuated objects are no longer needed, so we just store its original size in
37 // the LDV field.
38 #define SET_EVACUAEE_FOR_LDV(c, size)   \
39     LDVW((c)) = (size)
40
41 #endif /* PROFILING */
42
43 #endif /* LDVPROFILE_H */