Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / gc / dfs-mark.h
1 /* Copyright (C) 2012 Matthew Fluet.
2 * Copyright (C) 1999-2007 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 typedef enum {
13 MARK_MODE,
14 UNMARK_MODE,
15 } GC_markMode;
16
17 #endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
18
19 #if (defined (MLTON_GC_INTERNAL_FUNCS))
20
21 static inline bool isPointerMarked (pointer p);
22 static inline bool isPointerMarkedByMode (pointer p, GC_markMode m);
23 static size_t dfsMarkByMode (GC_state s, pointer root,
24 GC_markMode mode,
25 bool shouldHashCons,
26 bool shouldLinkWeaks);
27 static inline void dfsMarkWithHashConsWithLinkWeaks (GC_state s, objptr *opp);
28 static inline void dfsMarkWithoutHashConsWithLinkWeaks (GC_state s, objptr *opp);
29
30 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */