[Python-Dev] int/float freelists vs pymalloc

Christian Heimes lists at cheimes.de
Fri Feb 8 20:33:06 CET 2008


Neal Norwitz wrote:
> It's not just size.  Architectures may require data aligned on 4, 8,
> or 16 addresses for optimal performance depending on data type.  IIRC,
> malloc aligns by 8 (not sure if that was a particular arch or very
> common).  I don't know if pymalloc handles alignment.

Yes, pymalloc takes care of alignment. From Object/obmalloc.c:

Small requests are grouped in size classes spaced 8 bytes apart, due to
the required valid alignment of the returned address.



More information about the Python-Dev mailing list