[foreign-memaccess+abi] Integrated: Simplify ResourceScope::acquire for implicit scopes

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Apr 27 15:31:52 UTC 2021


On Tue, 27 Apr 2021 11:33:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> As suggested in [1], we can make the API for acquiring implicit scopes simpler if we tweak the implementation so that implicit scopes also implement the `HandleImpl` interface. If we do that, we could implement `acquire` by simply returning the implicit scope instance.
> 
> The simplification is that now, from a client perspective, acquiring a scope always gives back an handle that is associated with the original scope - we no longer *cheat* using the implicit scope handle singleton.
> 
> The acquire performance are not affected by this change (I've ran `BulkMismatchAcquire` before and after).
> 
> [1] - https://mail.openjdk.java.net/pipermail/panama-dev/2021-April/013516.html

This pull request has now been integrated.

Changeset: f189b8b3
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/f189b8b3
Stats:     45 lines in 5 files changed: 6 ins; 21 del; 18 mod

Simplify ResourceScope::acquire for implicit scopes

Reviewed-by: psandoz

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/523


More information about the panama-dev mailing list