RFR: 8316660: Use a MemorSegment for file mapping in FileChannelLinesSpliterator
Chen Liang
liach at openjdk.org
Thu Sep 21 10:52:04 UTC 2023
On Tue, 19 Sep 2023 08:52:29 GMT, Per Minborg <pminborg at openjdk.org> wrote:
> This PR proposes using a `MemorySegment` instead of a `ByteBuffer` in `FileChannelLinesSpliterator`.
>
> The old solution deterministically unmapped the ByteBuffer if closed. If not closed, the ByteBuffer would be GC:ed.
>
> This proposal mimics the old behavior but may hold the mapped memory region slightly longer.
>
> Tested and passed tier1, tier2, tier3
src/java.base/share/classes/java/nio/file/FileChannelLinesSpliterator.java line 199:
> 197: }
> 198:
> 199: private MemorySegment getMappedByteBuffer() {
This method's name should be updated now that the return type has changed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15814#discussion_r1329839027
More information about the nio-dev
mailing list