6978300: G1: debug builds crash if ParallelGCThreads==0
authorjcoomes
Wed, 25 Aug 2010 14:39:55 -0700
changeset 6425 206fd9fee2cf
parent 6424 9ab433735f7c
child 6426 cf377b51c52b
child 6427 97a16ae704a5
6978300: G1: debug builds crash if ParallelGCThreads==0 Reviewed-by: tonyp, ysr
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Aug 25 08:44:58 2010 -0400
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Aug 25 14:39:55 2010 -0700
@@ -2753,7 +2753,7 @@
   print_taskqueue_stats_hdr(st);
 
   TaskQueueStats totals;
-  const int n = MAX2(workers()->total_workers(), 1);
+  const int n = workers() != NULL ? workers()->total_workers() : 1;
   for (int i = 0; i < n; ++i) {
     st->print("%3d ", i); task_queue(i)->stats.print(st); st->cr();
     totals += task_queue(i)->stats;
@@ -2764,7 +2764,7 @@
 }
 
 void G1CollectedHeap::reset_taskqueue_stats() {
-  const int n = MAX2(workers()->total_workers(), 1);
+  const int n = workers() != NULL ? workers()->total_workers() : 1;
   for (int i = 0; i < n; ++i) {
     task_queue(i)->stats.reset();
   }