On Fri, 1 May 2026 05:16:08 GMT, David Holmes <[email protected]> wrote:

>> Casper Norrbin has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   feedback fixes
>
> src/hotspot/share/memory/heapInspection.cpp line 605:
> 
>> 603:   ResourceMark rm;
>> 604:   char* normalized_name = NEW_RESOURCE_ARRAY(char, strlen(class_name) + 
>> 1);
>> 605:   strcpy(normalized_name, class_name);
> 
> Do we have to make a copy here rather than modifying in place? The 
> user-supplied string is already in a mutable C-heap allocated buffer, as 
> processed by the DCmd framework. If we think it inappropriate to modify at 
> this level perhaps we can push the conversion up into the DCmd framework 
> itself?

There's already a `Symbol::as_klass_external_name(char* buf, int size)` method 
to do the  '/'s into '.'s conversion. Should this code be moved to a new 
`Symbol::as_klass_internal_name(char* buf, int size)` method?

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2375#discussion_r3173537136

Reply via email to