Implicit scope handle

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Apr 27 11:37:09 UTC 2021


On 27/04/2021 01:04, Radosław Smogura wrote:
> If we don’t want handles to be autoclosable than implicit scope can implement handle, and aquire would return this.

This is a good suggestion - I've just submitted a PR which does this:

https://github.com/openjdk/panama-foreign/pull/523

Now, all implicit scopes implement `HandleImpl`. Acquiring an implicit 
scope returns the implicit scope itself (no instance creation). 
Moreover, implicit scopes implement `HandleImpl::release()` so that it 
is a no-op.

This means that, from the perspective of clients, acquiring a scope 
behaves in a more uniform fashion.

Maurizio



More information about the panama-dev mailing list