Where'd my memory go? (was Re: [Python-Dev] Dictionary sparseness)

Tim Peters tim.one@comcast.net
Tue, 06 May 2003 12:30:14 -0400


[M.-A. Lemburg]
> Hmm, looking at the code it seems that the different blocks
> are not referencing each other. Wouldn't it be possible to link
> them together as list of blocks ? This list could then be used
> for the review operation.

The blocks are linked together; that's what the _intblock.next pointer does.
See PyInt_Fini().

> Would using the block technique from the int implementation
> make a difference for the frame objects ? I would guess that a
> typical Python program rarely has more than 100 frames alive
> at any one time. These could be placed into such a block to
> make setting them up faster, possible making Python function
> calls a tad snippier.

frame objects have variable size; int objects have fixed size; variable size
objects don't play nice with fixed block sizes.  Note that the frame
allocation code already tries to reuse whatever initialization it can left
over from the frame object it (normally) pulls off the frame free list.