1 #ifndef __MONO_OS_GC_WRAPPER_H__
2 #define __MONO_OS_GC_WRAPPER_H__
11 /* libgc specifies this on the command line,
12 * so we must define it ourselfs
14 # define GC_GCJ_SUPPORT
18 * Local allocation is only beneficial if we have __thread
19 * We had to fix a bug with include order in libgc, so only do
20 * it if it is the included one.
23 # if defined(HAVE_KW_THREAD) && defined(USE_INCLUDED_LIBGC) && !defined(__powerpc__)
24 # define GC_REDIRECT_TO_LOCAL
29 # include <gc/gc_typed.h>
30 # include <gc/gc_mark.h>
31 # include <gc/gc_gcj.h>
32 # elif defined(HAVE_GC_H) || defined(USE_INCLUDED_LIBGC)
34 # include <gc_typed.h>
38 # error have boehm GC without headers, you probably need to install them by hand
40 /* for some strange resion, they want one extra byte on the end */
41 # define MONO_GC_REGISTER_ROOT(x) \
42 GC_add_roots ((char*)&(x), (char*)&(x) + sizeof (x) + 1)
43 /* this needs to be called before ANY gc allocations. We can't use
44 * mono_gc_init here because we need to make allocations before that
47 # define MONO_GC_PRE_INIT() GC_init ()
49 #if defined(PLATFORM_WIN32)
50 #define CreateThread GC_CreateThread
54 # define MONO_GC_REGISTER_ROOT(x) /* nop */
55 # define MONO_GC_PRE_INIT()