[Python-Dev] pymalloc killer

Tim Peters tim.one@comcast.net
Fri, 29 Mar 2002 19:11:13 -0500


[martin@v.loewis.de]
> ...
> The pool in question and the arena it belongs to may have different
> starting addresses (in 63 of 64 cases, they will be different).

Currently, they always have different addresses, as at least the first 4
bytes of an arena are used to link arenas together.  If we save the arena
base addresses in a vector instead, the link becomes unnecessary (well, it's
not actually *used* for anything now anyway), and then the arena-rounding
logic can be changed so that the first pool can coincide with the arena
start if malloc just happens to return a page-aligned address for the arena
(as the code is now, in that case the entire first page is devoted to
holding s next-arena pointer).

> Of course, you could also build the table for pool addresses,
> assigning pool indices - but that would require 64 times as much
> memory.

Bingo -- I don't want to do that.