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

Jorn Vernee jvernee at openjdk.org
Thu Jun 22 19:21:35 UTC 2023


On Thu, 22 Jun 2023 16:36:48 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/foreign/MemoryLayout.java line 456:
>> 
>>> 454:      * {@code 0 <= x_i < b_i}, where {@code 1 <= i <= n}, or {@link IndexOutOfBoundsException} is thrown.
>>> 455:      * <p>
>>> 456:      * Multiple path sections can be chained, with <a href=#deref-path-elements>dereference path elements</a>.
>> 
>> I'm not too fond of the "path section" concept. Perhaps we could just talk about paths and sub-paths? Not 100% sure. A possible angle would be to show that a path containing dereference elements is broken up into distinct paths, which are then joined together using combinators.
>
> The previous doc talks about deref paths at the end, but then shows an alternative way to compute the accessed address. I thought this looked conflicting, so I changed this part to talk about the simple case first.
> 
> We could pull up the full blown address computation as well

I've uploaded a new version which attempts to improve this by merging the two paragraphs about offset computation. I'm not sure which version is better, though... Given the length of the text, I feel like we need _some_ kind of concept that refer to sections of a path which don't contain dereference path elements.

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

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


More information about the panama-dev mailing list