Revert "Revert "Merge branch 'master' of https://github.com/mono/mono""
[mono.git] / mono / metadata / sgen-stw.c
index 92e031dc3fe014e5e7cf82a1bb2b6c091ffb281f..5a2ab0e968730c6085c111060753d217ae5f6b7c 100755 (executable)
@@ -50,7 +50,7 @@ align_pointer (void *ptr)
 }
 
 #ifdef USE_MONO_CTX
-static MonoContext cur_thread_ctx = {0};
+static MonoContext cur_thread_ctx;
 #else
 static mword cur_thread_regs [ARCH_NUM_REGS] = {0};
 #endif
@@ -244,7 +244,8 @@ sgen_stop_world (int generation)
        time_stop_world += TV_ELAPSED (stop_world_time, end_handshake);
 
        sgen_memgov_collection_start (generation);
-       sgen_bridge_reset_data ();
+       if (sgen_need_bridge_processing ())
+               sgen_bridge_reset_data ();
 
        return count;
 }
@@ -306,7 +307,8 @@ sgen_restart_world (int generation, GGTimingInfo *timing)
 
        sgen_try_free_some_memory = TRUE;
 
-       sgen_bridge_processing_finish (generation);
+       if (sgen_need_bridge_processing ())
+               sgen_bridge_processing_finish (generation);
 
        TV_GETTIME (end_bridge);
        bridge_usec = TV_ELAPSED (end_sw, end_bridge);