[foreign-memaccess+abi] Integrated: 8303757: MemorySegment::reinterpret should accept an Arena
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Mar 7 19:11:44 UTC 2023
On Tue, 7 Mar 2023 15:42:45 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This patch tweaks the signature of `MemorySegment::reinterpret` to accept `Arena` instead of just `MemorySegment.Scope`. After some more thinking, I realized that the current scope-accepting methods imply that there is an action at a distance: passing an arena scope to `MemorySegment::reinterpret` not only results in new temporal bounds (which is ok, since `Scope` is about that), but also sets confinement constraints too (which is surprising, as a `Scope` doesn't have a notion of confinement).
>
> For this reason, I've dialled back the signature to take an `Arena`. This makes the API more consistent (now "of course" the confinement properties of the returned segment will be specified by the provided arena). It also removes a bit of verbosity at the use site, as doing `arena.scope()` is no longer required.
This pull request has now been integrated.
Changeset: 8dcd168e
Author: Maurizio Cimadamore <mcimadamore at openjdk.org>
URL: https://git.openjdk.org/panama-foreign/commit/8dcd168ef7f765d1379edbac972ffc4751997c64
Stats: 75 lines in 18 files changed: 25 ins; 6 del; 44 mod
8303757: MemorySegment::reinterpret should accept an Arena
Reviewed-by: jvernee
-------------
PR: https://git.openjdk.org/panama-foreign/pull/812
More information about the panama-dev
mailing list