244 void FreeRegionList::verify() { 245 // See comment in HeapRegionSetBase::verify() about MT safety and 246 // verification. 247 check_mt_safety(); 248 249 // This will also do the basic verification too. 250 verify_start(); 251 252 verify_list(); 253 254 verify_end(); 255 } 256 257 void FreeRegionList::clear() { 258 _count = HeapRegionSetCount(); 259 _head = NULL; 260 _tail = NULL; 261 _last = NULL; 262 } 263 264 void FreeRegionList::print_on(outputStream* out, bool print_contents) { 265 HeapRegionSetBase::print_on(out, print_contents); 266 out->print_cr(" Linking"); 267 out->print_cr(" head : " PTR_FORMAT, p2i(_head)); 268 out->print_cr(" tail : " PTR_FORMAT, p2i(_tail)); 269 270 if (print_contents) { 271 out->print_cr(" Contents"); 272 FreeRegionListIterator iter(this); 273 while (iter.more_available()) { 274 HeapRegion* hr = iter.get_next(); 275 hr->print_on(out); 276 } 277 } 278 279 out->cr(); 280 } 281 282 void FreeRegionList::verify_list() { 283 HeapRegion* curr = _head; 284 HeapRegion* prev1 = NULL; 285 HeapRegion* prev0 = NULL; 286 uint count = 0; 287 size_t capacity = 0; 288 uint last_index = 0; 289 290 guarantee(_head == NULL || _head->prev() == NULL, "_head should not have a prev"); 291 while (curr != NULL) { 292 verify_region(curr); 293 294 count++; 295 guarantee(count < _unrealistically_long_length, 296 "[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: " PTR_FORMAT " prev0: " PTR_FORMAT " " "prev1: " PTR_FORMAT " length: %u", 297 name(), count, p2i(curr), p2i(prev0), p2i(prev1), length()); 298 299 if (curr->next() != NULL) { 300 guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up"); 301 } | 244 void FreeRegionList::verify() { 245 // See comment in HeapRegionSetBase::verify() about MT safety and 246 // verification. 247 check_mt_safety(); 248 249 // This will also do the basic verification too. 250 verify_start(); 251 252 verify_list(); 253 254 verify_end(); 255 } 256 257 void FreeRegionList::clear() { 258 _count = HeapRegionSetCount(); 259 _head = NULL; 260 _tail = NULL; 261 _last = NULL; 262 } 263 264 void FreeRegionList::verify_list() { 265 HeapRegion* curr = _head; 266 HeapRegion* prev1 = NULL; 267 HeapRegion* prev0 = NULL; 268 uint count = 0; 269 size_t capacity = 0; 270 uint last_index = 0; 271 272 guarantee(_head == NULL || _head->prev() == NULL, "_head should not have a prev"); 273 while (curr != NULL) { 274 verify_region(curr); 275 276 count++; 277 guarantee(count < _unrealistically_long_length, 278 "[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: " PTR_FORMAT " prev0: " PTR_FORMAT " " "prev1: " PTR_FORMAT " length: %u", 279 name(), count, p2i(curr), p2i(prev0), p2i(prev1), length()); 280 281 if (curr->next() != NULL) { 282 guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up"); 283 } |