[foreign-memaccess+abi] RFR: 8296417: Make memory session a pure lifetime abstraction [v6]

Maurizio Cimadamore mcimadamore at openjdk.org
Sat Nov 5 00:55:55 UTC 2022


On Fri, 4 Nov 2022 23:56:40 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix SegmentAllocator.slicingAllocator to throw IIOBE
>
> test/micro/org/openjdk/bench/java/lang/foreign/StrLenTest.java line 162:
> 
>> 160:             }
>> 161:             MemorySegment res = current.allocate(byteSize, byteAlignment);
>> 162:             rem -= segment.segmentOffset(res);
> 
> I think this should be `rem = segment.byteSize() - segment.segmentOffset(res);` right? Otherwise more and more is subtracted on subsequent allocations.

good catch!

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

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


More information about the panama-dev mailing list