Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / gc / forward.h
1 /* Copyright (C) 2012,2016 Matthew Fluet.
2 * Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
5 *
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
8 */
9
10 #if (defined (MLTON_GC_INTERNAL_TYPES))
11
12 struct GC_forwardState {
13 bool amInMinorGC;
14 pointer back;
15 pointer toStart;
16 pointer toLimit;
17 };
18
19 #endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
20
21 #if (defined (MLTON_GC_INTERNAL_FUNCS))
22
23 #if ASSERT
24 static inline bool isPointerInToSpace (GC_state s, pointer p);
25 static inline bool isObjptrInToSpace (GC_state s, objptr op);
26 #endif
27
28 static inline objptr* getFwdPtrp (pointer p);
29 static inline objptr getFwdPtr (pointer p);
30 static inline bool hasFwdPtr (pointer p);
31 static inline void forwardObjptr (GC_state s, objptr *opp);
32 static inline void forwardObjptrIfInNursery (GC_state s, objptr *opp);
33 static inline void forwardInterGenerationalObjptrs (GC_state s);
34
35 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */