Skip to content

Commit

Permalink
Use sizeof(char) instead of sizeof(char*) pass to pointer_delta
Browse files Browse the repository at this point in the history
  • Loading branch information
sendaoYan committed Jan 8, 2025
1 parent 5052dcf commit d2bfa7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotspot/share/memory/memoryReserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ ReservedSpace HeapReserver::Instance::try_reserve_range(char *highest_start,
assert(is_aligned(highest_start, attach_point_alignment), "precondition");
assert(is_aligned(lowest_start, attach_point_alignment), "precondition");

const size_t attach_range = pointer_delta(highest_start, lowest_start, sizeof(char*));
const size_t attach_range = pointer_delta(highest_start, lowest_start, sizeof(char));
const size_t num_attempts_possible = (attach_range / attach_point_alignment) + 1;
const size_t num_attempts_to_try = MIN2((size_t)HeapSearchSteps, num_attempts_possible);
const size_t num_intervals = num_attempts_to_try - 1;
Expand Down

0 comments on commit d2bfa7d

Please sign in to comment.