RFR: 8329728: Read arbitrarily long lines in ClassListParser
ioi.lam at oracle.com
ioi.lam at oracle.com
Mon Apr 15 03:19:06 UTC 2024
Hi John,
Thanks for posting the code. Let me try to rebase your code onto
mainline, and then apply my ClassListParser changes on top of that. I
will probably open a new PR that combines this PR (#18669) and yours.
Let see how that looks and we can decide how to proceed.
Thanks
- Ioi
On 4/14/24 12:34 AM, John Rose wrote:
> I have been developing something on the back burner for robust
> text input. I got tired of looking at fixed-sized buffers for
> the compiler oracle and CDS, and now that CDS is scaling up
> in its demands for complex configuration files, I agree we
> need something better.
>
> Here’s my draft work:
> https://github.com/openjdk/jdk/pull/18773
>
> Please consider adopting it as a foundation for better CDS
> configuration reading. It’s old work, based to the repo
> as of about a year ago. But it should rebase easily.
>
> Thanks,
> — John
>
> P.S. As a next layer I’d like to make something like sscanf,
> except that it operates on the inputStream, like print_cr
> does formatted output on outputStream, but in the reverse
> direction. But for starters we need a solid foundation
> for flexible line-oriented input.
>
>
> On 7 Apr 2024, at 21:56, Ioi Lam wrote:
>
>> 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.
>>
>> -------------
>>
>> Commit messages:
>> - 8329728: Read arbitrarily long lines in ClassListParser
>>
>> Changes: https://git.openjdk.org/jdk/pull/18669/files
>> Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18669&range=00
>> Issue: https://bugs.openjdk.org/browse/JDK-8329728
>> Stats: 235 lines in 5 files changed: 193 ins; 18 del; 24 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