RFR: 8347143: [aix] Fix strdup use in os::dll_load [v2]
Christoph Langer
clanger at openjdk.org
Mon Jan 13 16:53:46 UTC 2025
On Mon, 13 Jan 2025 16:51:11 GMT, Joachim Kern <jkern at openjdk.org> wrote:
>> The use of strdup (which is os::strdup because of context) in aix's os::dll_load is odd. The result is nearly unused (it's passed to strrchr, but the original filename could be used instead), so the duplication doesn't seem needed. And the duplicate is free'd using FREE_C_HEAP_ARRAY, which seems wrong.
>
> Joachim Kern has updated the pull request incrementally with one additional commit since the last revision:
>
> Copyright dates
The new code is definitely better, good work. From eyeballing it, I also think it is correct. 😄 While you're at it, I have two other style nits that could be fixed.
src/hotspot/os/aix/os_aix.cpp line 1073:
> 1071: const char new_extension[] = ".a";
> 1072: // First try to load the existing file.
> 1073: int eno=0;
Suggestion:
int eno = 0;
src/hotspot/os/aix/os_aix.cpp line 1075:
> 1073: int eno=0;
> 1074: result = dll_load_library(filename, &eno, ebuf, ebuflen);
> 1075: // If the load fails,we try to reload by changing the extension to .a for .so files only.
Suggestion:
// If the load fails, we try to reload by changing the extension to .a for .so files only.
-------------
Marked as reviewed by clanger (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/23078#pullrequestreview-2547225317
PR Review Comment: https://git.openjdk.org/jdk/pull/23078#discussion_r1913500286
PR Review Comment: https://git.openjdk.org/jdk/pull/23078#discussion_r1913500626
More information about the hotspot-runtime-dev
mailing list