[foreign-jextract] RFR: Add MemoryLayout::byteOffset
mcimadamore at openjdk.java.net
Mon May 11 09:53:43 UTC 2020
On Mon, 11 May 2020 08:30:40 GMT, Chris Hegarty <chegar at openjdk.org> wrote:
> As part of feedback on the Foreign Memory API (when experimenting with
> its usage internally in the JDK), a small number of potential usability
> enhancements could be made to the API. This is the first such.
> This change:
> 1) renames MemoryLayout::offset to MemoryLayout::bitOffset, and
> 2) adds MemoryLayout::byteOffset
> This allows for easier interoperation with MemoryAddress, which deals
> with offsets and lengths in terms of bytes (rather than bits), e.g.
> This brings a nice symmetry to the API; there is a trio of bit-wise
> methods: bitAlignment, bitOffset, bitSize, and their matching byte-wise
> counterparts; byteAlignment, byteOffset, byteSize.
Looks very good - many thanks!
Marked as reviewed by mcimadamore (Committer).
More information about the panama-dev