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

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Feb 10 11:22:21 UTC 2023


On Thu, 9 Feb 2023 17:55:04 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>> 
>>  - Merge branch 'foreign-memaccess+abi' into arena_centric
>>  - Fix typo
>>  - Clarify javadoc for Arena::close
>>  - Fix linker javadoc
>>  - Initial push
>
> src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java line 89:
> 
>> 87:     public static Arena arena(MemorySegment segment) {
>> 88:         return ((AbstractMemorySegmentImpl)segment).scope.asArena();
>> 89:     }
> 
> I can't find any usages of this.

was used in VaList implementations, now removed

> src/java.base/share/classes/jdk/internal/foreign/MemorySessionImpl.java line 63:
> 
>> 61: 
>> 62:     public static final MemorySessionImpl GLOBAL = new GlobalSession(null, false);
>> 63:     public static final MemorySessionImpl NATIVE = new GlobalSession(null, true);
> 
> I don't get why this distinction is needed. GlobalSession has an isInternal() predicate but I don't see it called anywhere.
> 
> Could you explain why we need 2 kinds of global session?

We no longer need `isInternal`. But we do need, I think, another session for native segments returned by linker, so that comparisons against global arena's scope would fail.

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

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


More information about the panama-dev mailing list