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 /* The local alloc stuff is in pthread_support.c, but solaris uses solaris_threads.c */
25 # if !defined(__sparc__)
26 # define GC_REDIRECT_TO_LOCAL
32 # include <gc/gc_typed.h>
33 # include <gc/gc_mark.h>
34 # include <gc/gc_gcj.h>
35 # elif defined(HAVE_GC_H) || defined(USE_INCLUDED_LIBGC)
37 # include <gc_typed.h>
41 # error have boehm GC without headers, you probably need to install them by hand
43 /* for some strange resion, they want one extra byte on the end */
44 # define MONO_GC_REGISTER_ROOT(x) \
45 GC_add_roots ((char*)&(x), (char*)&(x) + sizeof (x) + 1)
46 /* this needs to be called before ANY gc allocations. We can't use
47 * mono_gc_init here because we need to make allocations before that
50 # define MONO_GC_PRE_INIT() GC_init ()
52 #if defined(PLATFORM_WIN32)
53 #define CreateThread GC_CreateThread
57 # define MONO_GC_REGISTER_ROOT(x) /* nop */
58 # define MONO_GC_PRE_INIT()