On Wed, 29 Nov 2023 22:16:53 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
>> I think the easiest solution is probably just coming up with some reasonable >> max sequence number and then just assuming that you will need enough chars >> for it. But if you want to actually compute it, there are a few solutions, >> including a simple div by 10 loop. > > Nice catch! This spot attracted my eyes as well on the first reading. > `sprintf` can be simple to use: > > char result[100]; > int number_of_digits = sprintf(result, "%d", seq); I decided to always reserve 10 symbols (theoretical max number of GC threads is 2^15) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16665#discussion_r1410021999