summaryrefslogtreecommitdiff
path: root/rts/sm/Evac.h
blob: 26d0c9eddb52d486c6e95f6274572166ea928740 (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
50
51
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team 1998-2008
 *
 * Generational garbage collector: evacuation functions
 *
 * Documentation on the architecture of the Garbage Collector can be
 * found in the online commentary:
 * 
 *   http://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
 *
 * ---------------------------------------------------------------------------*/

#ifndef SM_EVAC_H
#define SM_EVAC_H

#include "BeginPrivate.h"

// Use a register argument for evacuate, if available.
// Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this
// generated warnings on PPC. So the use is restricted further.
// See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html that says
//     regparm (number)
//         On the Intel 386, the regparm attribute causes the compiler to pass
//         arguments number one to number if they are of integral type in
//         registers EAX, EDX, and ECX instead of on the stack. Functions that
//         take a variable number of arguments will continue to be passed all of
//         their arguments on the stack.
#if __GNUC__ >= 2 && (defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH))
#define REGPARM1 __attribute__((regparm(1)))
#else
#define REGPARM1
#endif

REGPARM1 void evacuate  (StgClosure **p);
REGPARM1 void evacuate1 (StgClosure **p);

extern W_ thunk_selector_depth;

#include "EndPrivate.h"

#endif /* SM_EVAC_H */


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