[foreign-memaccess+abi] RFR: 8265751: MemoryAddress should have a scope accessor [v3]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Fri Apr 23 16:28:36 UTC 2021
On Fri, 23 Apr 2021 15:50:50 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Javadoc of MemoryAddress::equals is still segment-centric
>
> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java line 132:
>
>> 130: * @throws UnsupportedOperationException if this address is an heap address.
>> 131: */
>> 132: MemorySegment asSegment(long bytesSize, ResourceScope scope);
>
> Do we need to throw ISE if the existing scope is closed etc.? I think the implementation will do so, since it eventually calls `toRawLongValue()` (in `NativeMemorySegmentImpl.makeNativeSegmentUnchecked`) i.e. the method is predicated on the scope that is being replaced.
very good point - yes, this will fail - and not only because of the address scope - but also because of the new scope.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/513
More information about the panama-dev
mailing list