Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/hotspot/share/runtime/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,11 @@ char* os::attempt_reserve_memory_between(char* min, char* max, size_t bytes, siz
return nullptr; // overflow
}

char* const hi_att = align_down(MIN2(max, absolute_max) - bytes, alignment_adjusted);
char* const hi_end = MIN2(max, absolute_max);
if ((uintptr_t)hi_end < bytes) {
return nullptr; // no need to go on
}
char* const hi_att = align_down(hi_end - bytes, alignment_adjusted);
if (hi_att > max) {
return nullptr; // overflow
}
Expand Down