RFR: JDK-8329850: [AIX] Allow loading of different members of same shared library archive
Martin Doerr
mdoerr at openjdk.org
Tue Apr 9 14:54:09 UTC 2024
On Mon, 8 Apr 2024 13:04:05 GMT, Joachim Kern <jkern at openjdk.org> wrote:
>> src/hotspot/os/aix/porting_aix.cpp line 1061:
>>
>>> 1059: hash = (hash << 5) - hash + (unsigned long)*substr++;
>>> 1060: }
>>> 1061: }
>>
>> Should work in practical cases, but what if a hash collision occurs?
>
> How likely is a hash collision? My first thought was to store the member string in an additional array. But there is no length limitation. So I cannot just add an char array of e.g. 20 chars, but have to use a pointer to an external dynamically loaded memory holding the string. I came to the conclusion that a hash is much more elegant with a neglectable small risk of a hash collision.
I guess extremely unlikely. But if it happens, it will be an extremely annoying problem.
I'd probably use strdup, but let's hear what other reviewers think.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18676#discussion_r1557791032
More information about the hotspot-runtime-dev
mailing list