RFR: 8333843: Provide methods on MemorySegment to read strings with known lengths [v2]

Per Minborg pminborg at openjdk.org
Thu Sep 12 12:44:41 UTC 2024


> This PR proposes to add a new overload to `MemorySegment::getString` whereby it is possible to pass in a known byte length of the content in a segment that should be converted to a String. This is useful in case one already knows the byte length and thereby does not need to scan for a null terminator.

Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:

 - Remove trailing blanks
 - Add back extra line break
 - Add copyright year
 - Update copyright year
 - Revoke change to copyright year
 - Reinstate code
 - Move logic to doc
 - Merge branch 'master' into ms-string-known-length
 - Add copyright year
 - Add MemorySegment::getString overload

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20725/files
  - new: https://git.openjdk.org/jdk/pull/20725/files/8fb0e616..cc862a05

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20725&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20725&range=00-01

  Stats: 23542 lines in 797 files changed: 14212 ins; 4981 del; 4349 mod
  Patch: https://git.openjdk.org/jdk/pull/20725.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20725/head:pull/20725

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


More information about the core-libs-dev mailing list