RFR: JDK-8310233: Fix THP detection on Linux [v3]
Thomas Stuefe
stuefe at openjdk.org
Fri Jul 14 07:10:18 UTC 2023
On Fri, 14 Jul 2023 05:36:41 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Feedback johan
>
> src/hotspot/os/linux/hugepages.cpp line 92:
>
>> 90:
>> 91: // Given a file that contains a single (integral) number, return that number, 0 and false if failed.
>> 92: static bool read_number_file(const char* file, size_t* out) {
>
> Why `bool` return when you don't check it? Also `*out == 0` also indicates failure. Though why use an out parameter instead of just returning the value?
I will fix the caller to handle the error. Keeping error state from "0" return separate is just cleaner, and makes it possible to move/reuse this function should the need arise.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14739#discussion_r1263380896
More information about the hotspot-dev
mailing list