RFR: Tweak jextract to work with latest API changes

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Jul 20 12:32:29 UTC 2023


On Thu, 20 Jul 2023 12:26:01 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This PR fixes a bunch of issues with jextract that were introduced by the latest changes in the Panama repo:
> 
> * All var handles now take an extra offset parameter. This required changes to the libclang generated bindings, as well as changes in the code generated by jextract.
> * The name of some allocation factories in SegmentAllocator has changed. This PR fixes jextract to use the right names.
> * ValueLayout::arrayElementVarHandle is no longer present

src/main/java/org/openjdk/jextract/impl/StructBuilder.java line 300:

> 298:         append(vhConstant.accessExpression());
> 299:         append(".get(");
> 300:         append(seg + ", ");

Note that in this (and the setter) indexed accessor, we can now remove slicing, as we can simply pass the offset we want to the underlying var handle. This seems like a good thing.

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

PR Review Comment: https://git.openjdk.org/jextract/pull/124#discussion_r1269388659


More information about the jextract-dev mailing list