Revert "rts: add Emacs 'Local Variables' to every .c file"
[ghc.git] / rts / sm / Evac.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team 1998-2008
4 *
5 * Generational garbage collector: evacuation functions
6 *
7 * Documentation on the architecture of the Garbage Collector can be
8 * found in the online commentary:
9 *
10 * http://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
11 *
12 * ---------------------------------------------------------------------------*/
13
14 #ifndef SM_EVAC_H
15 #define SM_EVAC_H
16
17 #include "BeginPrivate.h"
18
19 // Use a register argument for evacuate, if available.
20 // Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this
21 // generated warnings on PPC. So the use is restricted further.
22 // See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html that says
23 // regparm (number)
24 // On the Intel 386, the regparm attribute causes the compiler to pass
25 // arguments number one to number if they are of integral type in
26 // registers EAX, EDX, and ECX instead of on the stack. Functions that
27 // take a variable number of arguments will continue to be passed all of
28 // their arguments on the stack.
29 #if __GNUC__ >= 2 && (defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH))
30 #define REGPARM1 __attribute__((regparm(1)))
31 #else
32 #define REGPARM1
33 #endif
34
35 REGPARM1 void evacuate (StgClosure **p);
36 REGPARM1 void evacuate1 (StgClosure **p);
37
38 extern W_ thunk_selector_depth;
39
40 #include "EndPrivate.h"
41
42 #endif /* SM_EVAC_H */
43