RFR: 8357086: os::xxx functions returning memory size should return size_t [v5]

Stefan Karlsson stefank at openjdk.org
Wed Jun 11 17:11:35 UTC 2025


On Wed, 11 Jun 2025 14:30:54 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'origin/master' into JDK-8357086_size_t_memfuncs
>>  - 8357086: Fixed spaces in formatting in gc-related code.
>>  - 8357086: Fixed formatting.
>>  - 8357086: Addressed reviewer's comments.
>>  - 8357086: More work.
>>  - 8357086: More work.
>>  - 8357086: More work.
>>  - 8357086: More work.
>>  - 8357086: More work.
>>  - 8357086: More work
>>  - ... and 2 more: https://git.openjdk.org/jdk/compare/058486c5...f3a5f61c
>
> src/hotspot/os/linux/os_linux.cpp line 261:
> 
>> 259:   }
>> 260:   log_trace(os)("available memory: " JULONG_FORMAT, avail_mem);
>> 261:   return static_cast<size_t>(avail_mem);
> 
> Line 243 should probably receive the same treatment (of `static_cast`)?

And 258 as well. Maybe we don't need the static cast here?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25450#discussion_r2140692110


More information about the hotspot-dev mailing list