[coop] Avoid taking the gc lock when rehashing mono_g_hash tables, its not needed...
authorZoltan Varga <vargaz@gmail.com>
Mon, 17 Aug 2015 19:21:25 +0000 (15:21 -0400)
committerZoltan Varga <vargaz@gmail.com>
Mon, 17 Aug 2015 19:21:45 +0000 (15:21 -0400)
mono/metadata/mono-hash.c

index 7ca1ebe857d0cba30c3ccc5eefa03abdff4df0a5..c450f94752cc88de86971e010222649902ad3e90 100644 (file)
@@ -221,7 +221,12 @@ rehash (MonoGHashTable *hash)
        data.new_size = g_spaced_primes_closest (hash->in_use);
        data.table = mg_new0 (Slot *, data.new_size);
 
+#ifdef USE_COOP_GC
+       /* We cannot be preempted */
+       old_table = do_rehash (&data);
+#else
        old_table = mono_gc_invoke_with_gc_lock (do_rehash, &data);
+#endif
        mg_free (old_table);
 }