RFR: 8308252: Refactor line-by-line file reading code [v3]
David Holmes
dholmes at openjdk.org
Tue May 23 06:15:50 UTC 2023
On Tue, 23 May 2023 03:33:54 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> src/hotspot/share/utilities/lineReader.cpp line 71:
>>
>>> 69: size_t buffer_pos = 0;
>>> 70: int c;
>>> 71: while ((c = getc(_stream)) != EOF) {
>>
>> Lets not read individual characters. Lets use fgets or fread() or just plain read(). Preferably the first.
>
> I've reimplemented using fgets().
So now this is not just a refactoring it is a re-implementation, so now I have to try and understand the reading logic and can't just treat it as known good code. :(
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14025#discussion_r1201582018
More information about the hotspot-dev
mailing list