RFR: 8308252: Refactor line-by-line file reading code [v3]

Ioi Lam iklam at openjdk.org
Thu May 18 21:03:51 UTC 2023


On Thu, 18 May 2023 00:31:08 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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.cpp line 47:
> 
>> 45:   }
>> 46: 
>> 47:   _buffer_length = 32;
> 
> This default buffer size may work well for the `ciReplay` case but for a general utility there should probably be a way to set the initial buffer length to avoid unnecessary resizing.

I'll add an initial size parameter that defaults to 160. That should be good to avoid expansion for most reasonable text input files, yet small enough. My feeling is that you usually don't care and don't know what size to set.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14025#discussion_r1198298370


More information about the hotspot-dev mailing list