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

Anton Artemov duke at openjdk.org
Wed Aug 6 09:27:30 UTC 2025


On Wed, 6 Aug 2025 03:50:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> I think this would change the usage pattern again. Do we want a failing assert  in every memory function in case of failure? I thought the consensus is that a false values returned by the function is indicating that. In this particular case it will be easy to trace which method failed as their results are stored as local variables.
>
> The assert should go after the syscall that we don't expect to fail, but which we have to tolerate the possibility of failing. That is the place where we can also report why the call failed.
> 
> I'm not sure what you mean about changing the usage pattern.

What I meant is that in this PR we are focusing on adding a mechanism to indicate that something failed, not on reporting why that fail. 

Addressed as suggested.

>> I suggest to keep results as locals, see my previous comment.
>
> Sorry I don't see a connection to previous comment about the assert. You only need a local if you need to refer to something more than once.

With the locals it would be visible in debugging which of those methods failed if any. 

Addressed as suggested.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25450#discussion_r2256537890
PR Review Comment: https://git.openjdk.org/jdk/pull/25450#discussion_r2256537325


More information about the hotspot-dev mailing list