On Sun, Mar 22, 2009 at 20:38, Christian Tismer
<tismer@stackless.com> wrote:
On 3/22/09 8:01 PM, "Martin v. Löwis" wrote:
Now, the internals are very clear to me. What I don't understand
is where the three saved bytes should be.
If you look at the various patches in
http://bugs.python.org/issue576101
then there is a three-byte saving in all versions from 1 to 6.
Consequentially, the API was changed in those versions (but only
starting from version 5, i.e. the first version created by Guido).
For some reason, the saving was then removed from the patch that
got actually committed (#7). I guess the comment just stayed.
Yes, funny, actually. At least, I don't find any comment why
the char was turned into an int, after all.
Are char pointers not on a word boundary problematic on some
platforms?
Or was it maybe to just keep the string layout on many
common platforms compatible, in order to save rebuilding
so many windows extension modules?
If the latter is true and the only reason, I vote for reclaiming
the three bytes. Maybe it saves a tree or two. Maybe it hurts
very little if done for Python 3000.
In any case, use the version that saves the most energy. :-)
not kidding - ciao -- chris
Actually, we should use the version that breaks the ABI the least. The change you're referring to actually (comparatively silently!) broke the ABI for 64-bit Python builds (at least, on LP64 and LLP64 systems, which is most of them.) You can normally relatively safely use an extension module built for Python 2.2 in Python 2.4, but not so for 64-bit builds. Let's try to keep the ABI compatible, and at least make it an error (not a warning) to load a truly incompatible ABI version.
--