[foreign] RFR 8219103: Add an offsetOf utility to find the offset of Struct fields

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Fri Feb 15 16:06:38 UTC 2019


I'm fine with that.

-Sundar

On 15/02/19, 9:27 PM, Jorn Vernee wrote:
> Subtle - I didn't notice that, thanks.
>
> I'd say we go with sizeOf/offsetOf, since it fits better with the rest 
> of the Java API (e.g. Struct.toString).
>
> Jorn
>
> Sundararajan Athijegannathan schreef op 2019-02-15 16:38:
>> Struct has "sizeof" but "offsetOf" ? Either sizeOf / offsetOf or
>> sizeof/offsetof (latter if we want to mimic C operator/macro).
>>
>> -Sundar
>>
>> On 15/02/19, 8:57 PM, Jorn Vernee wrote:
>>> Hi,
>>>
>>> This is an RFR for the earlier proposed offsetOf utility for finding 
>>> the offset of a field of a struct.
>>>
>>> This is based on Maurizio's suggestion to use the LayoutPath API 
>>> [1], with some minor tweaks and a test added.
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8219103
>>> Webrev: 
>>> http://cr.openjdk.java.net/~jvernee/panama/webrevs/8219103/webrev.00/
>>>
>>> Thanks,
>>> Jorn
>>>
>>> [1] : 
>>> https://mail.openjdk.java.net/pipermail/panama-dev/2019-February/004360.html


More information about the panama-dev mailing list