RFR: 8329728: Read long lines in ClassListParser [v4]

Ioi Lam iklam at openjdk.org
Wed Apr 10 17:37:21 UTC 2024


> Today the `ClassListParser` has a hard-coded limit of 4096 chars for each line in the CDS class list file. However, it's possible for a line to be much longer than than (64KB for the class name, plus extra information that can include path names, IDs, etc).
> 
> I wrote a utility class `LineReader` that automatically allocates a buffer before calling `fgets()`. Hopefully this can be useful for other cases where we call `fgets()` with a fixed buffer size.
> 
> Max line width is limited to 4M to simplify testing (and avoid running into corner cases when we approach INT_MAX).

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  @dholmes-ora and @calvinccheung comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18669/files
  - new: https://git.openjdk.org/jdk/pull/18669/files/05afb6ed..6471fca1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18669&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18669&range=02-03

  Stats: 49 lines in 6 files changed: 18 ins; 9 del; 22 mod
  Patch: https://git.openjdk.org/jdk/pull/18669.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18669/head:pull/18669

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


More information about the hotspot-dev mailing list