1 #ifndef __MONO_OS_GC_WRAPPER_H__
2 #define __MONO_OS_GC_WRAPPER_H__
8 /* libgc specifies this on the command line,
9 * so we must define it ourselfs
11 # define GC_GCJ_SUPPORT
13 * Local allocation is only beneficial if we have __thread
14 * We had to fix a bug with include order in libgc, so only do
15 * it if it is the included one.
18 # if defined(HAVE_KW_THREAD) && defined(USE_INCLUDED_LIBGC)
19 # define GC_REDIRECT_TO_LOCAL
24 # include <gc/gc_typed.h>
25 # include <gc/gc_mark.h>
26 # include <gc/gc_gcj.h>
27 # elif defined(HAVE_GC_H) || defined(USE_INCLUDED_LIBGC)
29 # include <gc_typed.h>
33 # error have boehm GC without headers, you probably need to install them by hand
35 /* for some strange resion, they want one extra byte on the end */
36 # define MONO_GC_REGISTER_ROOT(x) \
37 GC_add_roots ((char*)&(x), (char*)&(x) + sizeof (x) + 1)
38 /* this needs to be called before ANY gc allocations. We can't use
39 * mono_gc_init here because we need to make allocations before that
42 # define MONO_GC_PRE_INIT() GC_init ()
45 # define MONO_GC_REGISTER_ROOT(x) /* nop */
46 # define MONO_GC_PRE_INIT()