[foreign-memaccess+abi] RFR: 8317324: Add an overload to bind a memory segment var handle at an offset
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Sep 29 18:54:29 UTC 2023
On Fri, 29 Sep 2023 16:09:24 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This PR adds an overload which binds a memory segment var handle offset coordinate to a provided constant value.
>
> This is useful when the client knows that the accessed offset will be e.g. zero, or some other known constant value, thus reducing the number of coordinates that var handles clients will have to provide on each access.
I've added offset-accepting overloads for several methods. In the process it occurred to me that the javadoc of `MemoryLayout` contains some incorrect samples where the additional offset parameter is not passed to the resulting var handle.
Still on the fence on whether doing these change is worth it. But at the very least, the javadoc should be fixed.
-------------
PR Comment: https://git.openjdk.org/panama-foreign/pull/900#issuecomment-1741306335
More information about the panama-dev
mailing list