[Python-checkins] r46544 - in python/trunk:Include/dictobject.h Objects/dictobject.c

martin at v.loewis.de martin at v.loewis.de
Wed May 31 00:08:31 CEST 2006


Zitat von Jim Jewett <jimjjewett at gmail.com>:

> Why is this being done now?

Because it is correct; otherwise, truncation may occur.

> I also see a disadvantage in making all dictionary instances a little
> bit larger.

What do you mean by "all"? On a 32-bit system, there won't be
a change because sizeof(long)==sizeof(Py_ssize_t).

Actually, on a 64-bit system, there won't be a change in memory
usage, either, because me_hash is followed by me_key, and me_key
is 8-aligned. So there is currently 4 bytes of padding between
me_hash and me_key; with the patch, the padding is gone.

Regards,
Martin




More information about the Python-checkins mailing list