[foreign] RFR 8213343: Update the public access mode API

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Nov 21 16:10:02 UTC 2018


Overall your latest change looks good, so I'm approving here. Some 
comments inline below

On 21/11/2018 13:23, Jorn Vernee wrote:
> I was thinking about people writing libraries on top of panama. They 
> might want to create a bit of memory, write some values to it, and 
> then give out a read-only pointer to the client code. If the scope 
> only gives out read-only pointers, then writing to them can AFAICT 
> only take place on the native side. 

I think you can get to this either way - if access is a property of 
scopes, then you will have the library create a read-only scope and 
hand-off the pointer to that newly created scope. This is a pattern we 
have discussed internally.


As for arrays and cast, I think the test is probably in the wrong there, 
but let's discuss that separately.

Maurizio



More information about the panama-dev mailing list