Bug: MappedMemorySegmentImpl uses internal FileChannelImpl
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jun 29 16:32:54 UTC 2020
Note that to be able to map a file we need a file descriptor. The file
system you provided has support for channels, etc. but note that the
channels implementation do not support mapping using MappedByteBuffer:
https://github.com/google/jimfs/blob/master/jimfs/src/main/java/com/google/common/jimfs/JimfsFileChannel.java#L592
So I don't really see how we could make this work. At the end of the
day, MemorySegment.mapFromPath has to end up calling `mmap` - and we
need to be able to retrieve the parameters of the mmap call from somewhere.
Maurizio
On 29/06/2020 16:55, Ty Young wrote:
> Tried using Google's in-memory filesystem:
>
>
> https://github.com/google/jimfs
>
>
> for storing mmap files but ran into an issue because
> MappedMemorySegmentImpl uses internal FileChannelImpl method:
>
>
> https://github.com/openjdk/panama-foreign/blob/acc11115db42cc0e17efdf361d58c65f4e922f39/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/MappedMemorySegmentImpl.java#L105
>
>
>
> which causes a class casting exception when using Google's in-memory
> Java filesystem and probably other implementations as well.
>
>
>
More information about the panama-dev
mailing list