Skip to content

Commit

Permalink
Add "attach_point <= stepsize" check at the end of for loop, to make …
Browse files Browse the repository at this point in the history
…sanitizer silent and avoid warp around.
  • Loading branch information
sendaoYan committed Dec 31, 2024
1 parent aa5894f commit 9b09067
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hotspot/share/memory/memoryReserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ ReservedSpace HeapReserver::Instance::try_reserve_range(char *highest_start,

// Try attach points from top to bottom.
for (char* attach_point = highest_start;
attach_point >= lowest_start && attach_point <= highest_start && p2u(attach_point) > stepsize; // Avoid wrap around.
attach_point >= lowest_start; // Avoid wrap around.
attach_point -= stepsize) {
ReservedSpace reserved = try_reserve_memory(size, alignment, page_size, attach_point);

Expand All @@ -450,6 +450,9 @@ ReservedSpace HeapReserver::Instance::try_reserve_range(char *highest_start,

release(reserved);
}

if (p2u(attach_point) <= stepsize)
break; // Make sanizier silent and avoid warp around.
}

// Failed
Expand Down

0 comments on commit 9b09067

Please sign in to comment.