cpp: Use #pragma once instead of #ifndef guards
[ghc.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 #pragma once
11
12 #ifdef PROFILING
13
14 #include "ProfHeap.h"
15
16 RTS_PRIVATE void LdvCensusForDead ( uint32_t );
17 RTS_PRIVATE void LdvCensusKillAll ( void );
18
19 // Creates a 0-filled slop of size 'howManyBackwards' backwards from the
20 // address 'from'.
21 //
22 // Invoked when:
23 // 1) Hp is incremented and exceeds HpLim (in Updates.cmm).
24 // 2) copypart() is called (in GC.c).
25 #define LDV_FILL_SLOP(from, howMany) \
26 if (era > 0) { \
27 int i; \
28 for (i = 0;i < (howMany); i++) \
29 ((StgWord *)(from))[i] = 0; \
30 }
31
32 // Informs the LDV profiler that closure c has just been evacuated.
33 // Evacuated objects are no longer needed, so we just store its original size in
34 // the LDV field.
35 #define SET_EVACUAEE_FOR_LDV(c, size) \
36 LDVW((c)) = (size)
37
38 #endif /* PROFILING */