RFR Checks in Pointer.cast(LayoutType)

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Jun 18 15:23:31 UTC 2018


I like it. Very simple, yet it goes a long way in order to prevent silly 
mistakes.

Maurizio


On 18/06/18 15:41, Sundararajan Athijegannathan wrote:
> Pointer.cast(LayoutType) does not perform any checks as of now. Cast 
> to any destination pointee LayoutType is allowed. I've added 
> Layout.equals/.hashCode & simple checks in Pointer.cast(LayoutType) 
> for now. For now, cast from any pointer to void* and vice versa is 
> allowed. When pointee layouts are equal, the cast is allowed. Any 
> other case results in exception.
>
> Please review: 
> http://cr.openjdk.java.net/~sundar/pointer_cast_checks/webrev.01/
>
> Thanks,
> -Sundar



More information about the panama-dev mailing list