RFR: 8316660: (fs) Files.lines implementation can use MemorySegment for file mapping [v7]

Per Minborg pminborg at openjdk.org
Mon Oct 23 07:30:37 UTC 2023


On Thu, 21 Sep 2023 16:24:22 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR proposes using a `MemorySegment` instead of a `ByteBuffer` in the `Files::lines` implementation (in the internal class `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
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reformat

Keep alive.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15814#issuecomment-1774584634


More information about the nio-dev mailing list