[foreign-jextract] RFR: 8274155 Foreign API refresh - jextract update [v2]

Athijegannathan Sundararajan sundar at openjdk.java.net
Thu Sep 23 10:41:16 UTC 2021


On Thu, 23 Sep 2021 10:37:10 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> These are the jextract changes for the recent refresh of the Foreign Memory Access/Foreign Linker API. The biggest change in this API refresh comes from the removal of layout attributes. Jextract used to store several information in the form of layouts attributes. After some analysis, it turned out that in all cases, the use of layout attributes was not necessary, and it was really driven by the fact that jextract was, in certain places, using `MemoryLayout` as its main internal representation, instead of using the more flexible `Declaration`/`Type` APIs. Unfortunately, updating `RecordLayoutComputer` to work on `Declaration` rather than `MemoryLayout` caused changes in several part of the jextract parsing frontend.
>> 
>> Other minor changes were required, to adjust jextract to the new API changes - but most of these are small. I've dropped several now redundant overloads (so the size of the generated bindings should be smaller). There's also an additional piece of code which is used to emit typedef for common C primitive types such as `C_INT` and the likes (since the layouts for these are no longer in `CLinker`).
>> 
>> The test changes are mostly trivial updates to use the new API.
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review comments

Marked as reviewed by sundar (Committer).

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

PR: https://git.openjdk.java.net/panama-foreign/pull/577


More information about the panama-dev mailing list