RFR: 8354969: Add strdup function for ResourceArea [v3]

Johan Sjölen jsjolen at openjdk.org
Thu May 15 07:28:56 UTC 2025


On Thu, 15 May 2025 06:56:46 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/memory/allocation.hpp line 554:
>> 
>>> 552: 
>>> 553: #define RESOURCE_STRDUP_IN_THREAD(thread, src)\
>>> 554:   resource_strdup(thread, (char*)src)
>> 
>> Why the macros? I expected to see `ResourceObj::strdup` similar to `os::strdup`.
>
> Or `ResourceAraa::strdup`

I think the macros are just to imitate what was there previously, but I agree with David. It's better to not have these as macros, and prefer ordinary methods/functions.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24998#discussion_r2090475921


More information about the hotspot-dev mailing list