RFR: 8357086: os::xxx functions returning memory size should return size_t [v36]
Anton Artemov
duke at openjdk.org
Wed Aug 27 09:51:59 UTC 2025
On Tue, 26 Aug 2025 08:41:03 GMT, Anton Artemov <duke at openjdk.org> wrote:
>> Hi,
>>
>> in this PR the output value types for functions which return memory are changed, namely:
>>
>>
>> static julong available_memory(); --> static bool available_memory(size_t& value);
>> static julong used_memory(); --> static bool used_memory(size_t& value);
>> static julong free_memory(); --> static bool free_memory(size_t& value);
>> static jlong total_swap_space(); --> static bool total_swap_space(size_t& value);
>> static jlong free_swap_space(); --> static bool free_swap_space(size_t& value);
>> static julong physical_memory(); --> static size_t physical_memory(size_t& value);
>>
>>
>> The return boolean value, where available, indicates success, whereas the actual value is assigned to the input argument. The following recommended usage pattern is introduced: where applicable, an unsuccessful call is logged.
>>
>> Tested in GHA and Tiers 1-5.
>
> Anton Artemov has updated the pull request incrementally with two additional commits since the last revision:
>
> - 8357086: Removed extra empty line.
> - 8357086: Removed placeholder for nodiscard attribute.
I have re-run tests in tiers 1-3 on all available platforms, no problems detected after the latest changes on this branch.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25450#issuecomment-3227534780
More information about the hotspot-dev
mailing list