On Wed, 1 Apr 2026 08:37:44 GMT, Thomas Stuefe <[email protected]> wrote:

>> src/hotspot/os/windows/os_windows.cpp line 1069:
>> 
>>> 1067:   // Windows APIs require NUL-terminated strings; the name pointer
>>> 1068:   // may not be NUL-terminated, so copy into a stringStream.
>>> 1069:   stringStream ss;
>> 
>> Suggestion:
>> 
>>   stringStream ss(len);
>> 
>> We can avoid the need to grow on the write call. (Not sure if we need a +1 ?)
>
> Even better, just wrap it around a static buffer. Then, no allocation needed.
> 
>   char stack_buf[256];
>   stringStream ss(buf, sizeof(buf));

I've implemented @tstuefe's suggestion.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30374#discussion_r3021152739

Reply via email to