On Mon, 26 Jun 2023 17:47:25 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

> More casts for size of address differences in same code space, 
> checked_casts<> and type changes to fix -Wconversion warnings.  See CR for 
> details.
> Tested with tier1-4.

After some offline conversation with Ioi, we thought of a better way to express 
these pointer subtractions returning int, so I'm going to close this PR and 
open a new one with at least these changed with that new function.


// delta usually called with pointers or intptr_t that returns an int
// used for code buffer and other nearby address calculations.
// This allows the left side to be less than the right side.
template <typename T>
inline int delta_as_int(const volatile T left, const volatile T right) {
  return checked_cast<int>(left - right);
}

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14659#issuecomment-1608292000

Reply via email to