mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8242448: Change HeapRegionManager::guarantee_contiguous_range to be assert_contiguous_range
Reviewed-by: tschatzl, kbarrett
This commit is contained in:
parent
5dca7ec6b7
commit
b18e006b55
2 changed files with 9 additions and 7 deletions
|
@ -342,17 +342,19 @@ bool HeapRegionManager::is_on_preferred_index(uint region_index, uint preferred_
|
||||||
return region_node_index == preferred_node_index;
|
return region_node_index == preferred_node_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeapRegionManager::guarantee_contiguous_range(uint start, uint num_regions) {
|
#ifdef ASSERT
|
||||||
|
void HeapRegionManager::assert_contiguous_range(uint start, uint num_regions) {
|
||||||
// General sanity check, regions found should either be available and empty
|
// General sanity check, regions found should either be available and empty
|
||||||
// or not available so that we can make them available and use them.
|
// or not available so that we can make them available and use them.
|
||||||
for (uint i = start; i < (start + num_regions); i++) {
|
for (uint i = start; i < (start + num_regions); i++) {
|
||||||
HeapRegion* hr = _regions.get_by_index(i);
|
HeapRegion* hr = _regions.get_by_index(i);
|
||||||
guarantee(!is_available(i) || hr->is_free(),
|
assert(!is_available(i) || hr->is_free(),
|
||||||
"Found region sequence starting at " UINT32_FORMAT ", length " UINT32_FORMAT
|
"Found region sequence starting at " UINT32_FORMAT ", length " UINT32_FORMAT
|
||||||
" that is not free at " UINT32_FORMAT ". Hr is " PTR_FORMAT ", type is %s",
|
" that is not free at " UINT32_FORMAT ". Hr is " PTR_FORMAT ", type is %s",
|
||||||
start, num_regions, i, p2i(hr), hr->get_type_str());
|
start, num_regions, i, p2i(hr), hr->get_type_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uint HeapRegionManager::find_contiguous_in_range(uint start, uint end, uint num_regions) {
|
uint HeapRegionManager::find_contiguous_in_range(uint start, uint end, uint num_regions) {
|
||||||
assert(start <= end, "precondition");
|
assert(start <= end, "precondition");
|
||||||
|
@ -372,7 +374,7 @@ uint HeapRegionManager::find_contiguous_in_range(uint start, uint end, uint num_
|
||||||
break;
|
break;
|
||||||
} else if (i == unchecked) {
|
} else if (i == unchecked) {
|
||||||
// All regions of candidate sequence have passed check.
|
// All regions of candidate sequence have passed check.
|
||||||
guarantee_contiguous_range(candidate, num_regions);
|
assert_contiguous_range(candidate, num_regions);
|
||||||
return candidate;
|
return candidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ class HeapRegionManager: public CHeapObj<mtGC> {
|
||||||
// start index of that set, or G1_NO_HRM_INDEX.
|
// start index of that set, or G1_NO_HRM_INDEX.
|
||||||
uint find_contiguous_allow_expand(uint num_regions);
|
uint find_contiguous_allow_expand(uint num_regions);
|
||||||
|
|
||||||
void guarantee_contiguous_range(uint start, uint num_regions) ;
|
void assert_contiguous_range(uint start, uint num_regions) NOT_DEBUG_RETURN;
|
||||||
|
|
||||||
// Finds the next sequence of unavailable regions starting from start_idx. Returns the
|
// Finds the next sequence of unavailable regions starting from start_idx. Returns the
|
||||||
// length of the sequence found. If this result is zero, no such sequence could be found,
|
// length of the sequence found. If this result is zero, no such sequence could be found,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue