src/share/vm/gc_implementation/g1/heapRegionSeq.cpp

Print this page

        

@@ -215,12 +215,16 @@
   return NULL;
 }
 
 void HeapRegionSeq::iterate(HeapRegionClosure* blk) const {
   uint len = max_length();
+  iterate_range(blk, 0, len);
+}
 
-  for (uint i = 0; i < len; i++) {
+void HeapRegionSeq::iterate_range(HeapRegionClosure* blk, uint start, uint end) const {
+  assert(start <= end && end <= max_length(), "Invalid range.");
+  for (uint i = start; i < end; i++) {
     if (!is_available(i)) {
       continue;
     }
     guarantee(at(i) != NULL, err_msg("Tried to access region %u that has a NULL HeapRegion*", i));
     bool res = blk->doHeapRegion(at(i));