RFR: 8321971: Improve the user name detection logic in perfMemory get_user_name_slow [v2]

Jaikiran Pai jpai at openjdk.org
Wed Dec 20 12:21:44 UTC 2023


On Tue, 19 Dec 2023 20:13:58 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - David's review comments - reduce if blocks and release the array outside if block
>>  - David's review comment - punctuation
>
> src/hotspot/os/posix/perfMemory_posix.cpp line 609:
> 
>> 607:     if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) {
>> 608: 
>> 609:       if (statbuf.st_ctime > oldest_ctime) {
> 
> This `if` expression repeats what we already know to be true from the previous `if` expression.

Hello Chris, you are right - this additional `if` isn't needed. It looks like this is only there in `_posix` file and not in the `windows` version (which also intentionally doesn't have the file size check). I've updated this PR to fix this `_posix` one.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17104#discussion_r1432643800


More information about the hotspot-runtime-dev mailing list