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

Anton Artemov duke at openjdk.org
Wed May 28 07:26:30 UTC 2025


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 size_t total_swap_space();
static jlong free_swap_space(); --> static size_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.

---------
### Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 [Reviewer](https://openjdk.org/bylaws#reviewer))
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue

### Error
 ⚠️ The pull request body must not be empty.



### Reviewing
<details><summary>Using <code>git</code></summary>

Checkout this PR locally: \
`$ git fetch https://git.openjdk.org/jdk.git pull/25450/head:pull/25450` \
`$ git checkout pull/25450`

Update a local copy of the PR: \
`$ git checkout pull/25450` \
`$ git pull https://git.openjdk.org/jdk.git pull/25450/head`

</details>
<details><summary>Using Skara CLI tools</summary>

Checkout this PR locally: \
`$ git pr checkout 25450`

View PR using the GUI difftool: \
`$ git pr show -t 25450`

</details>
<details><summary>Using diff file</summary>

Download this PR as a diff file: \
<a href="https://git.openjdk.org/jdk/pull/25450.diff">https://git.openjdk.org/jdk/pull/25450.diff</a>

</details>

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

Commit messages:
 - 8357086: More work.
 - 8357086: More work.
 - 8357086: More work.
 - 8357086: More work.
 - 8357086: More work.
 - 8357086: More work
 - 8357086: size_t in mem funcs Linux
 - 8357086: use size_t for mem funcs on Windows

Changes: https://git.openjdk.org/jdk/pull/25450/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25450&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357086
  Stats: 116 lines in 19 files changed: 0 ins; 0 del; 116 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