File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -537,8 +537,7 @@ uint HeapRegionManager::find_highest_free(bool* expanded) {
537537 // Loop downwards from the highest region index, looking for an
538538 // entry which is either free or not yet committed. If not yet
539539 // committed, expand at that index.
540- uint curr = reserved_length () - 1 ;
541- while (true ) {
540+ for (uint curr = reserved_length (); curr-- > 0 ;) {
542541 HeapRegion *hr = _regions.get_by_index (curr);
543542 if (hr == NULL || !is_available (curr)) {
544543 // Found uncommitted and free region, expand to make it available for use.
@@ -547,17 +546,13 @@ uint HeapRegionManager::find_highest_free(bool* expanded) {
547546
548547 *expanded = true ;
549548 return curr;
550- } else {
551- if (hr->is_free ()) {
552- *expanded = false ;
553- return curr;
554- }
555549 }
556- if (curr == 0 ) {
557- return G1_NO_HRM_INDEX;
550+ if (hr->is_free ()) {
551+ *expanded = false ;
552+ return curr;
558553 }
559- curr--;
560554 }
555+ return G1_NO_HRM_INDEX;
561556}
562557
563558bool HeapRegionManager::allocate_containing_regions (MemRegion range, size_t * commit_count, WorkGang* pretouch_workers) {
You can’t perform that action at this time.
0 commit comments