[foreign-memaccess+abi] RFR: 8303757: MemorySegment::reinterpret should accept an Arena [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Mar 7 17:52:13 UTC 2023


On Tue, 7 Mar 2023 16:27:12 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Update src/java.base/share/classes/java/lang/foreign/MemorySegment.java
>>    
>>    Co-authored-by: Jorn Vernee <JornVernee at users.noreply.github.com>
>>  - Update src/java.base/share/classes/java/lang/foreign/MemorySegment.java
>>    
>>    Co-authored-by: Jorn Vernee <JornVernee at users.noreply.github.com>
>
> src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 604:
> 
>> 602:      * }
>> 603:      * That is, the cleanup action receives a segment that is associated with a fresh scope that is always alive,
>> 604:      * and is accessible from any thread. The size of the segment accepted by the cleanup action is {@code newSize}.
> 
> There's no `newSize` here. Looking at the implementation, I think this should be:
> Suggestion:
> 
>      * and is accessible from any thread. The size of the segment accepted by the cleanup action is {@link #byteSize()}.

Good catch!

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

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


More information about the panama-dev mailing list