[foreign] RFR 8209496: Minimize allocation in NativeInvoker::invokeNormal

John Rose john.r.rose at oracle.com
Thu Aug 16 01:00:51 UTC 2018


On Aug 15, 2018, at 4:22 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> . From a Java perspective, there's nothing for the type system to distinguish a stack-allocated vs. Java-heap-allocated struct. Which means that if objects we get back from native calls have extra restrictions layered on top, it might become painful for clients to wrestle with these limitations

This point is a delicate one:  how much to do with Java types and how much to leave to dynamic checks only. We do lifetime checks purely dynamically. The checks for addressibility (by native code) could also be purely dynamic; this is what I’m recommending we try.  I don’t think all Pointers are created equal:  some point to normal C data, some point to persistent data in XPoint memory, some point to Java heap, some are remote proxies into shared memory. Alternatively we have parallel interrelated types and conversions for all the categories of memory but that seems overkill to me. 


More information about the panama-dev mailing list