[foreign-memaccess+abi] RFR: 8310362: Improve composability of handle derived from layouts [v2]

Jorn Vernee jvernee at openjdk.org
Thu Jun 22 22:55:28 UTC 2023


On Thu, 22 Jun 2023 22:47:04 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> I initially consider negative inputs, I wasn't sure, but thought they might be useful in some cases, so I left them in.
>> 
>> multiplyExact/addExtact seems like a good idea to use.
>
> If the output of `scale` is always used as an offset parameter in some VH, or memory segment accessor, then I think there's a very strong gravitational pull for making it positive. I can't think of any methods in the MemorySegment API that would be happy with a negative offset, so it seems like a place where bugs might hide, or be reported in unexpected places.

That's a good point

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

PR Review Comment: https://git.openjdk.org/panama-foreign/pull/840#discussion_r1239098807


More information about the panama-dev mailing list