[foreign] RFR 8209497: Polish Resource API

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Tue Aug 14 14:58:17 UTC 2018


Looks good

-Sundar

On 14/08/18, 7:52 PM, Maurizio Cimadamore wrote:
> 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