Integrated: 8357086: os::xxx functions returning memory size should return size_t

Anton Artemov duke at openjdk.org
Mon Sep 1 07:46:01 UTC 2025


On Mon, 26 May 2025 12:56:26 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.

This pull request has now been integrated.

Changeset: d5d94db1
Author:    Anton Artemov <anton.artemov at oracle.com>
Committer: David Holmes <dholmes at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d5d94db12a6d82a6fe9da18b5f8ce3733a6ee7e7
Stats:     256 lines in 22 files changed: 94 ins; 2 del; 160 mod

8357086: os::xxx functions returning memory size should return size_t

Reviewed-by: stefank, dholmes

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

PR: https://git.openjdk.org/jdk/pull/25450


More information about the hotspot-dev mailing list