Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / gc / forward.h
CommitLineData
7f918cf1
CE
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
12struct 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
24static inline bool isPointerInToSpace (GC_state s, pointer p);
25static inline bool isObjptrInToSpace (GC_state s, objptr op);
26#endif
27
28static inline objptr* getFwdPtrp (pointer p);
29static inline objptr getFwdPtr (pointer p);
30static inline bool hasFwdPtr (pointer p);
31static inline void forwardObjptr (GC_state s, objptr *opp);
32static inline void forwardObjptrIfInNursery (GC_state s, objptr *opp);
33static inline void forwardInterGenerationalObjptrs (GC_state s);
34
35#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */