1 /* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
9 #if (defined (MLTON_GC_INTERNAL_TYPES))
12 * Thread objects are normal objects with the following layout:
16 * bytesNeeded (size_t) ::
17 * exnStack (size_t) ::
18 * stack (object-pointer)
20 * There may be zero or more bytes of padding for alignment purposes.
22 * The bytesNeeded size_t is the number of bytes needed when returning
25 * The exnStack size_t is an offset added to stackBottom that
26 * specifies the top of the exnStack.
28 * The final component is the stack object-pointer.
30 * Note that the order of the fields is important. The non-objptr
31 * fields must be first, because a thread object must appear to be a
34 typedef struct GC_thread
{
38 } __attribute__ ((packed
)) *GC_thread
;
40 COMPILE_TIME_ASSERT(GC_thread__packed
,
41 sizeof(struct GC_thread
) ==
46 #define BOGUS_EXN_STACK ((size_t)(-1))
51 typedef struct GC_thread
*GC_thread
;
53 #endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
55 #if (defined (MLTON_GC_INTERNAL_FUNCS))
57 static void displayThread (GC_state s
, GC_thread thread
, FILE *stream
);
58 static inline size_t sizeofThread (GC_state s
);
59 static inline size_t offsetofThread (GC_state s
);
61 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */