[foreign-memaccess+abi] Integrated: 8301801: Implement arena-centric API

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Feb 10 17:40:32 UTC 2023


On Tue, 7 Feb 2023 14:32:46 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch implements the API proposal described here:
> 
> https://cr.openjdk.java.net/~mcimadamore/panama/scoped_arenas.html
> 
> The main changes are:
> 
> * Static factories `MemorySegment::allocateNative` are gone;
> * The static factory `SegmentAllocator::nativeAllocator` is also gone;
> * `SegmentScope` moved as nested class in `MemorySegment` (e.g. `MemorySegment.Scope`);
> * Tweak methods accepting `SegmentScope` to accept `Arena` instead;
> * Simplify `Arena` API, by removing predicates (`isCloseable`/`isAccessibleBy`) and by dropping `whileAlive`;
> * Change arena factories to use `of` prefix instead of `open` - and rename `auto()` to `ofAuto()`.
> 
>  The API changes are rather straightforward, but they lead to several shallow test and microbenchmark changes, so the number of affected file is quite big (mostly because of the rename `openConfined` -> `ofConfined`).
> 
> A javadoc of the proposed changes is available here:
> 
> http://cr.openjdk.java.net/~mcimadamore/panama/scoped_arena_interface_lump_predicates/

This pull request has now been integrated.

Changeset: d501f737
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.org/panama-foreign/commit/d501f737977ea2186737c7d91e81a06725ea074c
Stats:     2469 lines in 165 files changed: 470 ins; 696 del; 1303 mod

8301801: Implement arena-centric API

Reviewed-by: jvernee

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

PR: https://git.openjdk.org/panama-foreign/pull/781


More information about the panama-dev mailing list