RFR: 8357086: os::xxx functions returning memory size should return size_t [v9]
Anton Artemov
duke at openjdk.org
Fri Jun 13 07:36:30 UTC 2025
On Thu, 12 Jun 2025 17:50:58 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> FWIW, I think that the `ssize_t` was a good first step and the `MemRes` was an experiment that would be interesting to see if how that panned out, but I didn't expect to see it in this PR. It tried to convey that in an earlier comment. I'm leaving it up to the other involved reviewers to decide if we should go with the MemRes change in this PR.
I understand that. Keeping `ssize_t` would not introduce consistency in the codebase, as on Windows `ssize_t` is `int64_t`, which is a signed type and, as pointed out by @tstuefe, it eats half of the possible range. I am not sure about other platforms, but I suspect that would not be the case there. Therefore I decided to rely on the known things such as `size_t `. But then, if we want to report more than one kind of error, it makes sense to keep the error code separately.
> Tons of MemErr's without examining the error part at all. I guess that's a
> consequence of the existing code just not bothering to check, which I guess
> needs to be fixed but not in this PR.
I agree, checking of error codes and making sure it is not easy to ignore them is to be done in a separate PR.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25450#issuecomment-2969393149
More information about the hotspot-dev
mailing list