RFR: 8357086: os::xxx functions returning memory size should return size_t [v18]
Anton Artemov
duke at openjdk.org
Thu Jul 31 07:31:42 UTC 2025
On Wed, 30 Jul 2025 15:35:11 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8357086: Fixed void conversion.
>
> src/hotspot/share/gc/shared/gcInitLogger.cpp line 70:
>
>> 68: } else {
>> 69: log_info_p(gc, init)("Memory: NA");
>> 70: }
>
> Suggestion:
>
> size_t memory = 0;
> if (os::physical_memory(memory)) {
> log_info_p(gc, init)("Memory: %zu%s", byte_size_in_proper_unit(memory), proper_unit_for_byte_size(memory));
> } else {
> log_info_p(gc, init)("Memory: NA");
> }
Addressed.
> src/hotspot/share/gc/z/zLargePages.cpp line 38:
>
>> 36: } else {
>> 37: log_info_p(gc, init)("Memory: NA");
>> 38: }
>
> Restore removed blank line and renamed abbreviated double-word local. I'm a bit extra picky with the code in ZGC (and GC):
> Suggestion:
>
>
> size_t memory = 0;
> if (os::physical_memory(memory)) {
> log_info_p(gc, init)("Memory: %zu%s", byte_size_in_proper_unit(memory), proper_unit_for_byte_size(memory));
> } else {
> log_info_p(gc, init)("Memory: NA");
> }
Addressed.
> src/hotspot/share/runtime/arguments.cpp line 1510:
>
>> 1508: void Arguments::set_heap_size() {
>> 1509: julong phys_mem;
>> 1510: size_t physical_mem_val = 0;
>
> Restore blankline:
> Suggestion:
>
> size_t physical_mem_val = 0;
Addressed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25450#discussion_r2244579031
PR Review Comment: https://git.openjdk.org/jdk/pull/25450#discussion_r2244579242
PR Review Comment: https://git.openjdk.org/jdk/pull/25450#discussion_r2244579360
More information about the hotspot-dev
mailing list