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

Severin Gehwolf sgehwolf at openjdk.org
Wed Jun 11 15:03:34 UTC 2025


On Wed, 11 Jun 2025 14:59:51 GMT, Anton Artemov <duke at openjdk.org> wrote:

>> Hi,
>> 
>> in this PR the output value type for functions which return memory are changed, namely:
>> 
>> 
>> static julong available_memory(); --> static size_t available_memory();
>> static julong used_memory(); --> static size_t used_memory();
>> static julong free_memory(); --> static size_t free_memory(); 
>> static jlong total_swap_space(); --> static ssize_t total_swap_space();
>> static jlong free_swap_space(); --> static ssize_t free_swap_space(); 
>> static julong physical_memory(); --> static size_t physical_memory(); 
>> 
>> 
>> The changes are done so that the other parts of the code have minimal impact. 
>> Tested in GHA and Tiers 1-4.
>
> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8357086: Changed return type for total_swap_space and free_swap_space to ssize_t

+1 to the `ssize_t` change. Much better than the `ptrdiff_t` version.

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

PR Review: https://git.openjdk.org/jdk/pull/25450#pullrequestreview-2917501538


More information about the hotspot-dev mailing list