News for hackers. Stuff that matters.
Re:Appending to an std:string character-by-character: how do... by rurban on Friday October 27, 2023 @02:34AM (#38035355)
Wonder why he didn't mention the correct growth factor for the geometric series, the golden ratio 1.618f.

It's only not used when shift by 1 was so much cheaper than float mult.

llvm's libc++ uses this grow logic instead:

    if (actual > 30)
      actual = ((actual & ~15) == actual) ? (actual + 15) 
               : ((actual + 15) & ~15) - 1;
which is actually closer to the metal, allocating a new page when needed.

There are no comments on this comment yet.