[sgen] Only count cards for STW protocol if heavy is enabled.
authorMark Probst <mark.probst@gmail.com>
Fri, 7 Nov 2014 19:53:56 +0000 (11:53 -0800)
committerMark Probst <mark.probst@gmail.com>
Thu, 13 Nov 2014 23:44:26 +0000 (15:44 -0800)
mono/metadata/sgen-stw.c

index 2a9bf34788c6826a485c41998a56dee33e553072..4d3bd9345f90b6746c54b5b87071a03d4b4a9a2b 100644 (file)
@@ -235,8 +235,9 @@ sgen_stop_world (int generation)
        mono_profiler_gc_event (MONO_GC_EVENT_POST_STOP_WORLD, generation);
        MONO_GC_WORLD_STOP_END ();
        if (binary_protocol_is_enabled ()) {
-               long long major_total, major_marked, los_total, los_marked;
-               count_cards (&major_total, &major_marked, &los_total, &los_marked);
+               long long major_total = -1, major_marked = -1, los_total = -1, los_marked = -1;
+               if (binary_protocol_is_heavy_enabled ())
+                       count_cards (&major_total, &major_marked, &los_total, &los_marked);
                binary_protocol_world_stopped (sgen_timestamp (), major_total, major_marked, los_total, los_marked);
        }
 
@@ -262,8 +263,9 @@ sgen_restart_world (int generation, GGTimingInfo *timing)
        unsigned long usec, bridge_usec;
 
        if (binary_protocol_is_enabled ()) {
-               long long major_total, major_marked, los_total, los_marked;
-               count_cards (&major_total, &major_marked, &los_total, &los_marked);
+               long long major_total = -1, major_marked = -1, los_total = -1, los_marked = -1;
+               if (binary_protocol_is_heavy_enabled ())
+                       count_cards (&major_total, &major_marked, &los_total, &los_marked);
                binary_protocol_world_restarting (generation, sgen_timestamp (), major_total, major_marked, los_total, los_marked);
        }