4 ms·
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 cheape
by rurban 3y ago
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.