[foreign-memaccess+abi] Integrated: Beef up javadoc for base offset in var handles derived from layouts
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Oct 6 14:39:42 UTC 2023
On Tue, 3 Oct 2023 14:42:16 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This PR adds more javadoc to explain how base offsets in var handles obtained from layouts can be used.
>
> First, a number of examples in the main `MemoryLayout` javadoc is rectified, as such examples did not use the additional base offset parameter (and were hence incorrect).
>
> Second, the var handles part in the `MemorySegment` section on "accessing memory segment" has been rewritten to avoid duplication with the concepts exposed in `MemoryLayout`. Now we show how `MemorySegment::get` and `MemorySegment::getAtIndex` can be obtained using basic var handles and combinators. We mention that more complex var handles can be obtained using layout paths, but we now just reference the layout path section.
>
> Last, I've added a new section on the `MemoryLayout` javadoc, with an example on how to deal with variable-length structs. This example showcases how var handles can be used in intricate situations, and combined with the new `scaleOffset` method.
This pull request has now been integrated.
Changeset: 8384a885
Author: Maurizio Cimadamore <mcimadamore at openjdk.org>
URL: https://git.openjdk.org/panama-foreign/commit/8384a885e822c85fd176f5d140f6d529e58a7f8a
Stats: 123 lines in 2 files changed: 78 ins; 17 del; 28 mod
Beef up javadoc for base offset in var handles derived from layouts
Reviewed-by: jvernee
-------------
PR: https://git.openjdk.org/panama-foreign/pull/901
More information about the panama-dev
mailing list