[foreign] RFR Add sizeof method to Struct type

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Thu Jul 26 15:06:00 UTC 2018


Shouldn't this be consistent ScopeImpl.allocateStruct? user would 
typically allocateStruct and pass then pass ptr and size of that, right?

-Sundar

On 26/07/18, 8:26 PM, Henry Jen wrote:
> I am not sure why we need the Util.alignUp call here, that’s supposed to be used for allocation to arrange address space.
>
> The layout should have proper padding and give the right size as if you call sizeof() in C on the struct.
>
> Otherwise, SystemABI.sizeof(Layout) should give you the right size based on platform.
>
> Cheers,
> Henry
>
>
>> On Jul 26, 2018, at 1:50 AM, Sundararajan Athijegannathan<sundararajan.athijegannathan at oracle.com>  wrote:
>>
>> Please review.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8208284
>> Webrev: http://cr.openjdk.java.net/~sundar/8208284/webrev.00/
>>
>> Thanks,
>> -Sundar


More information about the panama-dev mailing list