summaryrefslogtreecommitdiff
path: root/rts/LdvProfile.h
blob: 8f633225b90ebce766240c1df9d1792119070e96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2001
 * Author: Sungwoo Park
 *
 * Lag/Drag/Void profiling.
 *
 * ---------------------------------------------------------------------------*/

#ifndef LDVPROFILE_H
#define LDVPROFILE_H

#ifdef PROFILING

#include "ProfHeap.h"

RTS_PRIVATE void LdvCensusForDead ( nat );
RTS_PRIVATE void LdvCensusKillAll ( void );

// Creates a 0-filled slop of size 'howManyBackwards' backwards from the
// address 'from'. 
//
// Invoked when: 
//   1) Hp is incremented and exceeds HpLim (in Updates.hc).
//   2) copypart() is called (in GC.c).
#define LDV_FILL_SLOP(from, howMany)	\
  if (era > 0) {				\
    int i;					\
    for (i = 0;i < (howMany); i++)	\
      ((StgWord *)(from))[i] = 0;		\
  }

// Informs the LDV profiler that closure c has just been evacuated.
// Evacuated objects are no longer needed, so we just store its original size in
// the LDV field.
#define SET_EVACUAEE_FOR_LDV(c, size)   \
    LDVW((c)) = (size)

#endif /* PROFILING */

#endif /* LDVPROFILE_H */

// Local Variables:
// mode: C
// fill-column: 80
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// End: