File: objptr.h

package info (click to toggle)
mlton 20130715-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 60,900 kB
  • ctags: 69,386
  • sloc: xml: 34,418; ansic: 17,399; lisp: 2,879; makefile: 1,605; sh: 1,254; pascal: 256; python: 143; asm: 97
file content (35 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Copyright (C) 2005-2007 Henry Cejtin, Matthew Fluet, Suresh
 *    Jagannathan, and Stephen Weeks.
 *
 * MLton is released under a BSD-style license.
 * See the file MLton-LICENSE for details.
 */

#if (defined (MLTON_GC_INTERNAL_TYPES))

#define OBJPTR_TYPE__(z) uint ## z ## _t
#define OBJPTR_TYPE_(z) OBJPTR_TYPE__(z)
#define OBJPTR_TYPE OBJPTR_TYPE_(GC_MODEL_OBJPTR_SIZE)
typedef OBJPTR_TYPE objptr;
#define OBJPTR_SIZE sizeof(objptr)
#define PRIxOBJPTR__(z) PRIx ## z
#define PRIxOBJPTR_(z) PRIxOBJPTR__(z)
#define PRIxOBJPTR PRIxOBJPTR_(GC_MODEL_OBJPTR_SIZE)
#define FMTOBJPTR "0x%016"PRIxOBJPTR

COMPILE_TIME_ASSERT(sizeof_voidStar__gte__sizeof_objptr,
                    sizeof(void*) >= sizeof(objptr));

#define BOGUS_OBJPTR (objptr)0x1

#endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */

#if (defined (MLTON_GC_INTERNAL_FUNCS))

static inline bool isObjptr (objptr p);
static inline pointer objptrToPointer (objptr O, pointer B);
static inline objptr pointerToObjptr (pointer P, pointer B);
static inline pointer fetchObjptrToPointer (pointer OP, pointer B);
static inline void storeObjptrFromPointer (pointer OP, pointer P, pointer B);

#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */