[foreign] RFR : Move array-like methods from Pointer to Array

Jorn Vernee jbvernee at xs4all.nl
Mon Nov 19 16:46:26 UTC 2018


I hadn't even thought of that use case :)

I agree that there should be no crashes in that case, and I think that's 
the current reality (with or without my patch). The use case for 
EVERYTHING is when a native function returns a pointer, since you don't 
know the bounds. For everything else there should be bounds checks.

Jorn

Maurizio Cimadamore schreef op 2018-11-19 17:24:
> On 19/11/2018 16:01, Jorn Vernee wrote:
>> I think the API is inherently unsafe, unless you strictly stay on the 
>> Java side, but that kind of defeats the point.
> 
> Yes and no.
> 
> Consider the use case of a programmer that is only interested in the
> off heap aspect, but not in the native interop use case. Actually,
> this is going to be more common than you seem to imply (in recent
> conferences I've seen several frameworks attempting to reduce GC
> pressure by allocating off heap).
> 
> If that's the case, it would be nice if we could guarantee absence of
> VM crashes - after all we know what's being allocated, and how long
> the pointers will be alive for.
> 
> Maurizio


More information about the panama-dev mailing list