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