RFR: 8257184: Upstream 8252504: Add a method to MemoryLayout which returns a offset-computing method handle
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Fri Nov 27 10:50:58 UTC 2020
On Fri, 27 Nov 2020 09:11:30 GMT, Chris Hegarty <chegar at openjdk.org> wrote:
>> This upstreams the patch from: https://github.com/openjdk/panama-foreign/pull/396
>>
>> There were only some minor merge conflicts due to imports and some tests being replaced by java/foreign/TestNulls. All tests still pass, no other changes were needed.
>>
>> CSR: https://bugs.openjdk.java.net/browse/JDK-8257187
>
> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java line 423:
>
>> 421: * arguments, whereas {@code c_1}, {@code c_2}, ... {@code c_m} and {@code s_0}, {@code s_1}, ... {@code s_n} are
>> 422: * <em>static</em> stride constants which are derived from the layout path.
>> 423: *
>
> Would it be worth adding a simple example that demonstrates how this particular MH can be used, e.g.
> with a sequence layout of say 10 Java ints ?
Good idea - note though that we have a section in the toplevel javadoc which describes a complex layout and how to get info out of it using the various methods in this API (including MemoryLayout::varHandle). Perhaps that would be a good place where to add the example, rather than in the method javadoc?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1468
More information about the core-libs-dev
mailing list