[foreign-memaccess+abi] Integrated: 8264434: Remove ResourceScope-less overload from API

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Mar 30 18:13:26 UTC 2021


On Tue, 30 Mar 2021 14:42:07 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch does a bunch of API cleanups related to overloaded methods:
> 
> * Remove ResouceScope-less overloads (in MemorySegment, CLinker, MemoryAddress, VaList)
> * Remove ResourceScope factory overloads which take Object attachment (in ResourceScope)
> * Fixup javadoc
> 
> The changes are mostly mechanical - e.g. an extra ResourceScope.ofImplicit() is added wherever needed.
> Similarly, for address to segment conversion, an extra ResourceScope.globalScope() is added.
> 
> The term *implicit* has been selected to denote the subset of scopes that are not only managed by a Cleaner, but that do not play into explicit deallocation.
> 
> So, ResourceScope.ofImplicit() returns a new implicit scope, whereas ResourceScope.globalScope, returns a constant implicit scope which is assumed to be alive for the entire duration of the application.
> 
> A new predicate has been added on ResourceScope, namely `isImplicit` which allows client to see whether a segment supports deterministic closure (we used to have a similar predicate, but was called `isCloseable` and that created confusion w.r.t. the semantics of close() - the new naming is more apt, in that it clearly reflects a permanent property of the resource scope).

This pull request has now been integrated.

Changeset: a4ba76c3
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/a4ba76c3
Stats:     465 lines in 42 files changed: 42 ins; 293 del; 130 mod

8264434: Remove ResourceScope-less overload from API

Reviewed-by: psandoz, jvernee

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

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


More information about the panama-dev mailing list