[foreign-memaccess] RFR: Memory access implementation rewrite - post cleanup
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Wed Apr 15 14:36:40 UTC 2020
On Wed, 15 Apr 2020 13:48:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> * Fix access modes not preserved in AbstractMemorySegmentImpl.ofBuffer
>> * Add check to ensure that Foreign::withSize and Foreign::asMallocSegment are called with unchecked address
>
> test/jdk/java/foreign/TestByteBuffer.java line 624:
>
>> 623: { channel.map(FileChannel.MapMode.READ_WRITE, 0L, 256).asReadOnlyBuffer(),
>> 624: nativeTest /* this seems to be an existing bug in the BB implementation */ }
>> 625: };
>
> Note: this test uncovered an issue with mapped buffers: any projections of a mapped buffer (slices, read only) will
> create a direct buffer which will have lost the original file descriptor. As such, the behavior of the projection will
> not be one of a mapped buffer (e.g. calling force() will do nothing). As such, our implementation will simply return a
> native segment in such cases. I'll discuss this issue with somebody from core-libs.
Apparently, a very old issue :-)
https://bugs.openjdk.java.net/browse/JDK-4833719
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/111
More information about the panama-dev
mailing list