Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / gc / init-world.h
CommitLineData
7f918cf1
CE
1/* Copyright (C) 2014 Matthew Fluet.
2 * Copyright (C) 1999-2006 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/* GC_init uses the array of struct intInfInits in s at program start
13 * to allocate intInfs.
14 * The globalIndex'th entry of the globals array in s is set to the
15 * IntInf.int whose value corresponds to the mlstr string.
16 *
17 * The strings pointed to by the mlstr fields consist of
18 * an optional ~
19 * one of [1-9]
20 * zero or more of [0-9]
21 * a trailing EOS
22 */
23struct GC_intInfInit {
24 uint32_t globalIndex;
25 const char *mlstr;
26};
27
28/* GC_init allocates a collection of arrays/vectors in the heap. */
29struct GC_vectorInit {
30 size_t elementSize;
31 uint32_t globalIndex;
32 GC_arrayLength length;
33 pointer words;
34};
35
36#endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
37
38#if (defined (MLTON_GC_INTERNAL_FUNCS))
39
40static inline size_t sizeofInitialBytesLive (GC_state s);
41static void initVectors (GC_state s);
42static void initWorld (GC_state s);
43
44#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */