[sgen] Make hazard pointer stuff work without Mono, enabling concurrent M&S.
authorMark Probst <mark.probst@gmail.com>
Sat, 17 Jan 2015 00:30:21 +0000 (16:30 -0800)
committerMark Probst <mark.probst@gmail.com>
Wed, 29 Apr 2015 18:00:09 +0000 (11:00 -0700)
mono/metadata/sgen-client.h
mono/metadata/sgen-gc.c
mono/utils/hazard-pointer.c
mono/utils/lock-free-array-queue.c
mono/utils/monobitset.h

index ad138621541692d008ab3c895387c495c29956c6..b2b5f4adf6aaa22d110579415642478c3d602f20 100644 (file)
@@ -273,3 +273,8 @@ void sgen_client_print_gc_debug_usage (void);
 #undef TYPE_SIZE
 #undef TYPE_POINTER
 #undef TYPE_BOOL
+
+#ifdef SGEN_WITHOUT_MONO
+SgenThreadInfo* mono_thread_info_current (void);
+int mono_thread_info_get_small_id (void);
+#endif
index 4edfbed3e64acd756f4cd057cfc55055279f8072..3ad4cf78d4ecd0ca8bac5a7a62fd047ee2507bfb 100644 (file)
@@ -2975,6 +2975,10 @@ sgen_gc_init (void)
 
        SGEN_TV_GETTIME (sgen_init_timestamp);
 
+#ifdef SGEN_WITHOUT_MONO
+       mono_thread_smr_init ();
+#endif
+
        LOCK_INIT (gc_mutex);
 
        gc_debug_file = stderr;
index 6890db2941ae5bd65f1b7758a67c2ba25432321d..ced9cdad63dc9015800cd2eb38bd621646002df6 100644 (file)
@@ -6,16 +6,24 @@
 
 #include <config.h>
 
+#include <string.h>
+
 #include <mono/utils/hazard-pointer.h>
 #include <mono/utils/mono-membar.h>
 #include <mono/utils/mono-memory-model.h>
-#include <mono/utils/mono-mmap.h>
 #include <mono/utils/monobitset.h>
-#include <mono/utils/mono-threads.h>
 #include <mono/utils/lock-free-array-queue.h>
-#include <mono/utils/mono-counters.h>
 #include <mono/utils/atomic.h>
+#include <mono/utils/mono-mutex.h>
+#ifdef SGEN_WITHOUT_MONO
+#include <mono/metadata/sgen-gc.h>
+#include <mono/metadata/sgen-client.h>
+#else
+#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-counters.h>
 #include <mono/io-layer/io-layer.h>
+#endif
 
 typedef struct {
        gpointer p;
index fd069a640e32739d44e42c8319c2acc2bb10b769..7742d6555e146a647533cb1a3c7592f7bdec7203 100644 (file)
  * entry data, and then sets the state to USED or FREE.
  */
 
+#include <string.h>
+
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-membar.h>
+#ifdef SGEN_WITHOUT_MONO
+#include <mono/metadata/sgen-gc.h>
+#include <mono/metadata/sgen-client.h>
+#else
 #include <mono/utils/mono-mmap.h>
+#endif
 
 #include <mono/utils/lock-free-array-queue.h>
 
index 5bea9278394d1e7dd1a2f033c71cb2a47517807b..70366f8b1e8602f05c739abd248808c84e31c5fd 100644 (file)
@@ -2,7 +2,12 @@
 #define __MONO_BITSET_H__
 
 #include <glib.h>
+#ifdef SGEN_WITHOUT_MONO
+#include "mono/utils/mono-compiler.h"
+#define MONO_API
+#else
 #include <mono/utils/mono-publib.h>
+#endif
 
 /*
  * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any