[foreign-memaccess+abi] RFR: 8274219: Add back generic factory to create value layouts

Paul Sandoz psandoz at openjdk.java.net
Thu Sep 23 20:09:23 UTC 2021


On Thu, 23 Sep 2021 17:07:34 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch adds back a factory to create value layouts in a generic way. While we cannot make the API 100% type safe, some dynamic usages can greatly benefit from this. The `Binding` class provides a good example (greatly simplified here). Also, the logic for reconstructing layouts (see `describeConstable`) becomes a lot more regular.

Marked as reviewed by psandoz (Committer).

src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java line 685:

> 683: 
> 684:     /**
> 685:      * Create a value layout of given Java carrier and byte order. The type of resulting value layout is determined

Suggestion:

     * Creates a value layout of given Java carrier and byte order. The type of resulting value layout is determined

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

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


More information about the panama-dev mailing list