RFR: 8358799: Refactor os::jvm_path() [v2]

Calvin Cheung ccheung at openjdk.org
Tue Jun 10 01:31:31 UTC 2025


On Tue, 10 Jun 2025 00:39:06 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Calvin Cheung has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - review comments from @dholmes-ora and @jdksjolen
>>  - Merge branch 'master' into 8358799-refactor-jvm-path
>>  - 8358799: Refactor os::jvm_path()
>
> src/hotspot/os/posix/os_posix.cpp line 1071:
> 
>> 1069:     assert(false, "must use a large-enough buffer");
>> 1070:     buf[0] = '\0';
>> 1071:     return;
> 
> Do we need release the memory of `buf` before return, such like
> 
> 
> free(buf);

No, because the caller of the function still references `buf` after the function returns, e.g. in `os::init_system_properties_values()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25675#discussion_r2136751058


More information about the hotspot-runtime-dev mailing list