On Thu, 2 Apr 2026 05:22:37 GMT, Thomas Stuefe <[email protected]> wrote:
>> Educated guess? E.g. how long can thread-names realistically be, and how >> much can we realistically allocate on-stack? It's not a limit - when the >> string really is longer, then we allocate a temporary buffer on heap. > > @rkennke Sorry, I misunderstood you; I thought the 256 is the hard limit. I > looked it up, the limit is 32K of UCS2 characters. Bit large for a thread > stack. > > In that case, it would be better to use @dholmes-ora original proposal of > `stringStream ss(K * 32)`; > > Note that it will get converted to unicode below and copied at least once > again. I think 256 is reasonable to stack-allocate and avoid the 32K malloc in most be the absolute extreme cases. I'll keep it as it currently is, unless you have other objections. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30374#discussion_r3027021045
