RFR: 8316660: Use a MemorSegment for file mapping in FileChannelLinesSpliterator

Per Minborg pminborg at openjdk.org
Thu Sep 21 10:52:04 UTC 2023


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

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

Commit messages:
 - Fix typo
 - Rename variables
 - Add test for parallel use of FileChannelLinesSpliterator
 - Use CleanerFactory.cleaner()
 - Update javadoc to reflect the use of memory segment
 - Refactor cleanup
 - Merge branch 'master' into pz-fclinespliterator
 - Add a Cleaner
 - Rename method again
 - Rename method
 - ... and 1 more: https://git.openjdk.org/jdk/compare/fab372d3...9b23ecbe

Changes: https://git.openjdk.org/jdk/pull/15814/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15814&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316660
  Stats: 222 lines in 3 files changed: 165 ins; 23 del; 34 mod
  Patch: https://git.openjdk.org/jdk/pull/15814.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15814/head:pull/15814

PR: https://git.openjdk.org/jdk/pull/15814


More information about the nio-dev mailing list