[runtime] GC descriptor typedef.
[mono.git] / mono / sgen / gc-internal-agnostic.h
index 72eca3d0dc306ed9ba69faf89163f8f15824ab7d..b7e4b6708c0681b3dcad2d0d611912c9e40d252c 100644 (file)
@@ -27,6 +27,9 @@
 #include "mono/utils/mono-compiler.h"
 #include "mono/utils/parse.h"
 #include "mono/utils/memfuncs.h"
+#ifdef HAVE_SGEN_GC
+#include "mono/sgen/sgen-conf.h"
+#endif
 
 typedef struct {
        guint minor_gc_count;
@@ -38,6 +41,14 @@ typedef struct {
 
 extern GCStats gc_stats;
 
+#ifdef HAVE_SGEN_GC
+typedef SgenDescriptor MonoGCDescriptor;
+#define MONO_GC_DESCRIPTOR_NULL        SGEN_DESCRIPTOR_NULL
+#else
+typedef void* MonoGCDescriptor;
+#define MONO_GC_DESCRIPTOR_NULL NULL
+#endif
+
 /*
  * Try to register a foreign thread with the GC, if we fail or the backend
  * can't cope with this concept - we return FALSE.
@@ -46,17 +57,17 @@ extern gboolean mono_gc_register_thread (void *baseptr);
 
 gboolean mono_gc_parse_environment_string_extract_number (const char *str, size_t *out);
 
-void* mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size);
-void* mono_gc_make_descr_for_array (int vector, gsize *elem_bitmap, int numbits, size_t elem_size);
+MonoGCDescriptor mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size);
+MonoGCDescriptor mono_gc_make_descr_for_array (int vector, gsize *elem_bitmap, int numbits, size_t elem_size);
 
 /* simple interface for data structures needed in the runtime */
-void* mono_gc_make_descr_from_bitmap (gsize *bitmap, int numbits);
+MonoGCDescriptor mono_gc_make_descr_from_bitmap (gsize *bitmap, int numbits);
 
 /* Return a root descriptor for a root with all refs */
-void* mono_gc_make_root_descr_all_refs (int numbits);
+MonoGCDescriptor mono_gc_make_root_descr_all_refs (int numbits);
 
 /* Return the bitmap encoded by a descriptor */
-gsize* mono_gc_get_bitmap_for_descr (void *descr, int *numbits);
+gsize* mono_gc_get_bitmap_for_descr (MonoGCDescriptor descr, int *numbits);
 
 /*
 These functions must be used when it's possible that either destination is not