[foreign] RFR 8209497: Polish Resource API

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Aug 14 14:22:16 UTC 2018


Hi,
the Resource interface is currently empty, and it features an unused 
type parameter. This patch retcons the Resource API point to mean 
'anything that has a scope'. So, Resource now features a scope() 
accessor. The unused type parameter has been dropped.

Examples of resources are: structs, pointers, arrays.

Callbacks are NOT resources (since you can have a callback backed by a 
Java lambda), but they can _optionally_ be linked to one. So, for 
instance, if a callback has been allocated by the binder (as a wrapper 
around a true native function pointer), the resulting callback will have 
an associated resource (the native function pointer).

This is a very simple interpretation for the meaning of 'Resource', but 
I think it's quite effective.

Webrev:

http://cr.openjdk.java.net/~mcimadamore/panama/8209497/

Cheers
Maurizio



More information about the panama-dev mailing list