[foreign-jextract] [Rev 01] RFR: 8245066: struct/union/array address accessor should be x$ADDR() for consistency

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri May 15 09:50:11 UTC 2020

On Fri, 15 May 2020 08:15:31 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> * renamed struct/union/array accessor as x$ADDR
>> * Piggybacking to add a jextract based test for bug 8244938
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last
> revision:
>   added missing EXPORT for exported function

Question: consistency with what?

It seems to me that most accessors are in the form `<name>$<lowercase-accessor-kind>` - e.g. `foo$get`.

Then we have upper-case names for constants (e.g. layouts).

I can see us going either way here - e.g. treating the `addressof` as an accessor, or as a 'constant'. I slightly
prefer the former, as it corresponds to the `&` operator in C. E.g.

x.y // getter
x.y = ... // setter
&(x.y) // addressof


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

More information about the panama-dev mailing list