[Python-Dev] pymalloc killer

Tim Peters tim.one@comcast.net
Sat, 30 Mar 2002 14:37:07 -0500


>> There wouldn't be a hole if the vector of arena base addresses were
>> statically allocated.

[David Abrahams]
> This could be a reason to use the 2-level arena vector we were
> discussing earlier. I was just assuming you wouldn't ever want to
> reallocate it or move anything that big...

A 2-level vector would complicate the code in ways that slow it down in the
usual cases, so is unattractive.  These vectors are generally *small*:  on a
32-bit box, 1024 bytes of base-address vector is enough for that over 4 =
256 base addresses, which is enough to cover 2*8 * 2**18 = 64 megabytes of
arena memory.  Most programs will never go above that, and a one-time cost
of moving 1KB per 64MB is trivial.  It's quite attractive to just let the
old vectors leak.