Split MappedMemorySegment out of the hierarchy
Quân Anh Mai
anhmdq at gmail.com
Tue Dec 6 16:28:50 UTC 2022
Hi Panama experts,
The MemorySegment interface has several methods dedicated to supporting
MappedMemorySegment such as isMapped, load, etc. May I ask if we can make
it become a separate class that contains a NativeMemorySegment instead, and
make the dedicated methods members of the encompassing class instead? I
have taken a look at MappedMemorySegment and it seems that the only other
methods that need to be mappedness-specific are asSlice and makeByteBuffer.
And in that case, we can make asSlice and makeByteBuffer also methods for
the encompassing class, too.
This may make the interface clearer by not overloading MemorySegment with
methods that it is not really capable of, and also helps the JIT to emit
more optimised code for other operations with a more restricted hierarchy.
Thanks a lot for your reading and I really appreciate your responses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20221207/041dbbd4/attachment-0001.htm>
More information about the panama-dev
mailing list