[foreign-memaccess+abi] RFR: 8274157: java.foreign: Add method MemorySegment::asOverlappingSlice [v3]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Mon Oct 4 21:45:22 UTC 2021
On Mon, 4 Oct 2021 18:51:16 GMT, Radoslaw Smogura <github.com+7535718+rsmogura at openjdk.org> wrote:
>> Julia Boes has updated the pull request incrementally with one additional commit since the last revision:
>>
>> add test for overlap and offsetOf and update names
>
> src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java line 263:
>
>> 261: final long thatEnd = thatStart + that.byteSize() - 1L;
>> 262:
>> 263: if (thisStart <= thatEnd && thisEnd >= thatStart) { //overlap occurs
>
> Hi,
>
> Minor, I wonder if it would make sense to replace "weak" inequality with strong inequality and remove subtraction of 1 (two instructs less)?
I believe that has been addresses in the latest revision?
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/585
More information about the panama-dev
mailing list