cpp: Use #pragma once instead of #ifndef guards
[ghc.git] / includes / rts / prof / LDV.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The University of Glasgow, 2009
4 *
5 * Lag/Drag/Void profiling.
6 *
7 * Do not #include this file directly: #include "Rts.h" instead.
8 *
9 * To understand the structure of the RTS headers, see the wiki:
10 * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
11 *
12 * ---------------------------------------------------------------------------*/
13
14 #pragma once
15
16 #ifdef PROFILING
17
18 /* retrieves the LDV word from closure c */
19 #define LDVW(c) (((StgClosure *)(c))->header.prof.hp.ldvw)
20
21 /*
22 * Stores the creation time for closure c.
23 * This macro is called at the very moment of closure creation.
24 *
25 * NOTE: this initializes LDVW(c) to zero, which ensures that there
26 * is no conflict between retainer profiling and LDV profiling,
27 * because retainer profiling also expects LDVW(c) to be initialised
28 * to zero.
29 */
30
31 #ifdef CMINUSMINUS
32
33 #else
34
35 #define LDV_RECORD_CREATE(c) \
36 LDVW((c)) = ((StgWord)RTS_DEREF(era) << LDV_SHIFT) | LDV_STATE_CREATE
37
38 #endif
39
40 #else /* !PROFILING */
41
42 #define LDV_RECORD_CREATE(c) /* nothing */
43
44 #endif /* PROFILING */