RFR Checks in Pointer.cast(LayoutType)
Samuel Audet
samuel.audet at gmail.com
Mon Jun 18 21:47:24 UTC 2018
Sometimes we do need to cast between incompatible types though. Is the
idea to first force a cast to void*?
Samuel
On 06/19/2018 12:23 AM, Maurizio Cimadamore wrote:
> 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