RFR: 8354969: Add strdup function for ResourceArea

David Holmes dholmes at openjdk.org
Fri May 9 12:25:52 UTC 2025


On Fri, 9 May 2025 02:23:28 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Do we have any immediate candidate uses for this? Whilst in the past Hotspot code had a number of utility API's, these days there is a tendency to delete any unused code. So this really needs to have an imminent usage (@iklam ?) .
>> 
>> Code change itself looks fine. Thanks
>
>> Do we have any immediate candidate uses for this? Whilst in the past Hotspot code had a number of utility API's, these days there is a tendency to delete any unused code. So this really needs to have an imminent usage (@iklam ?) .
>> 
>> Code change itself looks fine. Thanks
> 
> I did this and found a few places, but there could be more
> 
> 
> find . -name *pp | xargs grep -l strcpy | \
>     xargs egrep -l '(RESOURCE.*char)|(resource_allocate_bytes)' | \
>     xargs grep strcpy
> 
> 
> https://github.com/openjdk/jdk/blob/9a0e6f338f34fb5da16d5f9eb710cdddd4302945/src/hotspot/share/prims/jvmtiEnvBase.cpp#L471-L472
> https://github.com/openjdk/jdk/blob/9a0e6f338f34fb5da16d5f9eb710cdddd4302945/src/hotspot/share/classfile/classLoader.cpp#L1513-L1514
> https://github.com/openjdk/jdk/blob/9a0e6f338f34fb5da16d5f9eb710cdddd4302945/src/hotspot/share/classfile/modules.cpp#L642-L643

Thanks @iklam ! So should we convert those places as part of this PR?

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

PR Comment: https://git.openjdk.org/jdk/pull/24998#issuecomment-2866350008


More information about the hotspot-dev mailing list