Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition [v3]

2021-01-06 Thread Maurizio Cimadamore
> Hi, > this patch fixes an oversight where the address() method in > FileChannelImpl.Unmapper does not take into account the value of > `pagePosition` - this leads to a situation in which, effectively, the > specified offset when mapping the segment is ignored by the runtime (because > base ad

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Uwe Schindler
On Tue, 5 Jan 2021 15:33:54 GMT, Maurizio Cimadamore wrote: > Hi, > this patch fixes an oversight where the address() method in > FileChannelImpl.Unmapper does not take into account the value of > `pagePosition` - this leads to a situation in which, effectively, the > specified offset when ma

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition [v2]

2021-01-05 Thread Alan Bateman
On Tue, 5 Jan 2021 17:28:10 GMT, Maurizio Cimadamore wrote: >> Hi, >> this patch fixes an oversight where the address() method in >> FileChannelImpl.Unmapper does not take into account the value of >> `pagePosition` - this leads to a situation in which, effectively, the >> specified offset wh

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition [v2]

2021-01-05 Thread Maurizio Cimadamore
> Hi, > this patch fixes an oversight where the address() method in > FileChannelImpl.Unmapper does not take into account the value of > `pagePosition` - this leads to a situation in which, effectively, the > specified offset when mapping the segment is ignored by the runtime (because > base ad

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Maurizio Cimadamore
On Tue, 5 Jan 2021 16:03:04 GMT, Uwe Schindler wrote: >> In fact the new test only checks if everything is aligned like we expect, >> but it does not test that our mapping returns a memory segment with expected >> contents. > > So I tend to make a simple test without reflection that writes a de

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Uwe Schindler
On Tue, 5 Jan 2021 15:55:10 GMT, Uwe Schindler wrote: >> test/jdk/java/foreign/TestByteBuffer.java line 28: >> >>> 26: * @modules java.base/sun.nio.ch >>> 27: * jdk.incubator.foreign/jdk.internal.foreign >>> 28: * @run testng/othervm --illegal-access=permit >>> -Dforeign.restricted=

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Uwe Schindler
On Tue, 5 Jan 2021 16:01:11 GMT, Uwe Schindler wrote: >> I am not sure if a test like this is really needed. >> The alignment is pageSize on Linux and some arbitrary value (65536) on >> Windows. If you have some test file that writes like a few bytes (1, 2, 3, >> 4,...) To a file and then maps

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Uwe Schindler
On Tue, 5 Jan 2021 15:44:50 GMT, Alan Bateman wrote: >> Hi, >> this patch fixes an oversight where the address() method in >> FileChannelImpl.Unmapper does not take into account the value of >> `pagePosition` - this leads to a situation in which, effectively, the >> specified offset when mappi

Re: [jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Alan Bateman
On Tue, 5 Jan 2021 15:33:54 GMT, Maurizio Cimadamore wrote: > Hi, > this patch fixes an oversight where the address() method in > FileChannelImpl.Unmapper does not take into account the value of > `pagePosition` - this leads to a situation in which, effectively, the > specified offset when ma

[jdk16] RFR: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition

2021-01-05 Thread Maurizio Cimadamore
Hi, this patch fixes an oversight where the address() method in FileChannelImpl.Unmapper does not take into account the value of `pagePosition` - this leads to a situation in which, effectively, the specified offset when mapping the segment is ignored by the runtime (because base address will al