< prev index next >

src/hotspot/share/gc/g1/heapRegionSet.cpp

Print this page
rev 52611 : webrev.00
rev 52613 : webrev.01


 220     remove(curr);
 221 
 222     count++;
 223     curr = next;
 224   }
 225 
 226   assert(count == num_regions,
 227          "[%s] count: %u should be == num_regions: %u",
 228          name(), count, num_regions);
 229   assert(length() + num_regions == old_length,
 230          "[%s] new length should be consistent "
 231          "new length: %u old length: %u num_regions: %u",
 232          name(), length(), old_length, num_regions);
 233 
 234   verify_optional();
 235 }
 236 
 237 uint FreeRegionList::num_of_regions_in_range(uint start, uint end) const {
 238   HeapRegion* cur = _head;
 239   uint num = 0;
 240   bool started = false;
 241   while (cur != NULL && cur->hrm_index() <= end) {
 242     if (!started && cur->hrm_index() >= start) {
 243       started = true;
 244     }
 245     if(started) {
 246       num++;
 247     }
 248     cur = cur->next();
 249   }
 250   return num;
 251 }
 252 
 253 void FreeRegionList::verify() {
 254   // See comment in HeapRegionSetBase::verify() about MT safety and
 255   // verification.
 256   check_mt_safety();
 257 
 258   // This will also do the basic verification too.
 259   verify_start();
 260 
 261   verify_list();
 262 
 263   verify_end();
 264 }
 265 




 220     remove(curr);
 221 
 222     count++;
 223     curr = next;
 224   }
 225 
 226   assert(count == num_regions,
 227          "[%s] count: %u should be == num_regions: %u",
 228          name(), count, num_regions);
 229   assert(length() + num_regions == old_length,
 230          "[%s] new length should be consistent "
 231          "new length: %u old length: %u num_regions: %u",
 232          name(), length(), old_length, num_regions);
 233 
 234   verify_optional();
 235 }
 236 
 237 uint FreeRegionList::num_of_regions_in_range(uint start, uint end) const {
 238   HeapRegion* cur = _head;
 239   uint num = 0;
 240   while (cur != NULL) {
 241     uint index = cur->hrm_index();
 242     if (index > end) {
 243       break;
 244     } else if (index >= start) {

 245       num++;
 246     }
 247     cur = cur->next();
 248   }
 249   return num;
 250 }
 251 
 252 void FreeRegionList::verify() {
 253   // See comment in HeapRegionSetBase::verify() about MT safety and
 254   // verification.
 255   check_mt_safety();
 256 
 257   // This will also do the basic verification too.
 258   verify_start();
 259 
 260   verify_list();
 261 
 262   verify_end();
 263 }
 264 


< prev index next >