RFR: 8308252: Refactor line-by-line file reading code [v3]
Calvin Cheung
ccheung at openjdk.org
Wed May 17 22:50:52 UTC 2023
On Wed, 17 May 2023 19:55:59 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> I extracted the `get_line()` code from `CompileReplay` and put it in a utility class so that it can be used by `ClassListParser` as well. A few notable changes:
>>
>> - Simplified the API
>> - Changed the buffer size to a size_t
>> - Added size overflow and OOM checks
>> - Brought over the `fdopen` logic from `ClassListParser` for handling long path names on Windows. (I don't know how valid this is nowadays, but I don't want to drop it in a refactoring PR).
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> fixed typo in comments
src/hotspot/share/utilities/lineReader.hpp line 48:
> 46: const char* filename() const { return _filename; }
> 47: char* get_line();
> 48: void close();
The `close()` doesn't need to be public.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14025#discussion_r1197132557
More information about the hotspot-dev
mailing list