On Fri, 9 Aug 2024 10:03:52 GMT, Johan Sjölen <jsjo...@openjdk.org> wrote:

>> The main purpose of the `if (...)` cases is to find if the request to apply 
>> the delta is valid or not. There are related assertions in VirtualMemory but 
>> not so informative. Also, using `log_debug` lets the build proceed and just 
>> show the messages.
>> These messages help a lot when something goes wrong in terms of 
>> commit/uncommit/release failure.
>
> How does my example code not account for this? You can still get rid of the 
> sign checking.

Case of 'commit' error is missing from your suggestion. At commit time, ` c > 
reserved` is invalid too.
`(size_t)-r` for positive `r` is a large number and is greater than `reserved`. 
We have to find out the intent of the call first (by checking the sign of `r` 
or `c`) and then check if it is valid or not.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1713513436

Reply via email to