RFR: 8357086: os::xxx functions returning memory size should return size_t [v10]
Anton Artemov
duke at openjdk.org
Fri Jun 13 09:56:49 UTC 2025
> Hi,
>
> in this PR the output value type for functions which return memory are changed, namely:
>
>
> static julong available_memory(); --> static MemRes available_memory();
> static julong used_memory(); --> static MemRes used_memory();
> static julong free_memory(); --> static MemRes free_memory();
> static jlong total_swap_space(); --> static MemRes total_swap_space();
> static jlong free_swap_space(); --> static MemRes free_swap_space();
> static julong physical_memory(); --> static MemRes physical_memory();
>
>
> `MemRes` is a struct containing a pair of values, `size_t val` to carry the return value, `int err` to carry the error if any. Currently, in case of error the latter is set to -1.
>
> 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: Addressed the reviewers comments.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25450/files
- new: https://git.openjdk.org/jdk/pull/25450/files/dd9275ca..ebf21bce
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25450&range=09
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25450&range=08-09
Stats: 140 lines in 16 files changed: 11 ins; 54 del; 75 mod
Patch: https://git.openjdk.org/jdk/pull/25450.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25450/head:pull/25450
PR: https://git.openjdk.org/jdk/pull/25450
More information about the hotspot-dev
mailing list