[foreign-memaccess+abi] RFR: 8274157: java.foreign: Add method MemorySegment::isOverlapping [v3]
Julia Boes
jboes at openjdk.java.net
Mon Oct 4 17:14:42 UTC 2021
On Mon, 4 Oct 2021 13:08:21 GMT, Maurizio Cimadamore <mcimadamore 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 260:
>
>> 258: final long thisStart = this.min();
>> 259: final long thatStart = that.min();
>> 260: final long thisEnd = thisStart + this.byteSize() - 1L;
>
> do you need the `-1L` (since then you need `<=`) ? E.g. can we drop the `- 1L` and use strict comparisons instead?
Yup, that's better!
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/585
More information about the panama-dev
mailing list