[sgen] Remove DISABLE_CRITICAL_REGION as it's never defined
authorLudovic Henry <ludovic@xamarin.com>
Mon, 11 Jan 2016 16:16:04 +0000 (16:16 +0000)
committerAleksey Kliger <aleksey@xamarin.com>
Thu, 14 Jan 2016 16:41:09 +0000 (11:41 -0500)
mono/metadata/sgen-client-mono.h
mono/sgen/sgen-alloc.c
mono/sgen/sgen-cardtable.c

index 71906968539f8ebb845ab1f53f5de001d4b8b222..2c0445c4a11dbb6eecd050a7e699b0d99af4233e 100644 (file)
@@ -675,8 +675,6 @@ extern MonoNativeTlsKey thread_info_key;
 #define IN_CRITICAL_REGION (__thread_info__->client_info.in_critical_region)
 #endif
 
-#ifndef DISABLE_CRITICAL_REGION
-
 #ifdef HAVE_KW_THREAD
 #define IN_CRITICAL_REGION sgen_thread_info->client_info.in_critical_region
 #else
@@ -691,8 +689,6 @@ extern MonoNativeTlsKey thread_info_key;
  */
 #define EXIT_CRITICAL_REGION  do { mono_atomic_store_release (&IN_CRITICAL_REGION, 0); } while (0)
 
-#endif
-
 #define SGEN_TV_DECLARE(name) gint64 name
 #define SGEN_TV_GETTIME(tv) tv = mono_100ns_ticks ()
 #define SGEN_TV_ELAPSED(start,end) ((long)(end-start))
index ca9d645e6aa78922de22b7aa2fa896e3eb7fbfa3..c6e6db176e47adc8a42a5ac8409a6521930b0a46 100644 (file)
@@ -426,8 +426,6 @@ sgen_alloc_obj (GCVTable vtable, size_t size)
        if (!SGEN_CAN_ALIGN_UP (size))
                return NULL;
 
-#ifndef DISABLE_CRITICAL_REGION
-
        if (G_UNLIKELY (has_per_allocation_action)) {
                static int alloc_count;
                int current_alloc = InterlockedIncrement (&alloc_count);
@@ -452,7 +450,7 @@ sgen_alloc_obj (GCVTable vtable, size_t size)
                return res;
        }
        EXIT_CRITICAL_REGION;
-#endif
+
        LOCK_GC;
        res = sgen_alloc_obj_nolock (vtable, size);
        UNLOCK_GC;
index b6e9479f1479e6a7f65a4acbd2433b470ed9dee1..f88b933a68e49f9d3e9fc3f81cda93d1f9e2d51a 100644 (file)
@@ -119,19 +119,13 @@ sgen_card_table_wbarrier_value_copy (gpointer dest, gpointer src, int count, siz
 {
        size_t size = count * element_size;
 
-#ifdef DISABLE_CRITICAL_REGION
-       LOCK_GC;
-#else
        TLAB_ACCESS_INIT;
        ENTER_CRITICAL_REGION;
-#endif
+
        mono_gc_memmove_atomic (dest, src, size);
        sgen_card_table_mark_range ((mword)dest, size);
-#ifdef DISABLE_CRITICAL_REGION
-       UNLOCK_GC;
-#else
+
        EXIT_CRITICAL_REGION;
-#endif
 }
 
 static void
@@ -139,20 +133,14 @@ sgen_card_table_wbarrier_object_copy (GCObject* obj, GCObject *src)
 {
        size_t size = sgen_client_par_object_get_size (SGEN_LOAD_VTABLE_UNCHECKED (obj), obj);
 
-#ifdef DISABLE_CRITICAL_REGION
-       LOCK_GC;
-#else
        TLAB_ACCESS_INIT;
        ENTER_CRITICAL_REGION;
-#endif
+
        mono_gc_memmove_aligned ((char*)obj + SGEN_CLIENT_OBJECT_HEADER_SIZE, (char*)src + SGEN_CLIENT_OBJECT_HEADER_SIZE,
                        size - SGEN_CLIENT_OBJECT_HEADER_SIZE);
        sgen_card_table_mark_range ((mword)obj, size);
-#ifdef DISABLE_CRITICAL_REGION
-       UNLOCK_GC;
-#else
+
        EXIT_CRITICAL_REGION;
-#endif 
 }
 
 static void