On 7/23/09 2:27 PM, Antoine Pitrou wrote:
Christian Tismer<tismer<at> stackless.com> writes:
...
I'm not sure a double aligned on a 4-byte boundary is "misaligned" on a x86 CPU.
I'm also not sure. Anyway, the result was neither intended nor expected, I guess.
Alignment is primarily important to avoid access violations on CPUs and datatypes which don't support arbitrary alignment, although it can also be useful for performance reasons.
Performance, performance, of course (that's my job, after all :-) ) ...
Of course, it will also make memory consumption a tad bigger for GC-enabled objects (but GC-enabled objects are generally not that small anyway).
For that reason, I don't like the addition of the opaque header too much. If there were an option to make the header explicit, we would not have to round up the object size to a multiple of (8, 16), but could arrange embedded doubles as they fit the best.
(I disagree, however, that we should remove the "long double". After all, we also want alignment of PyObjects to allow inclusion of a "long double" in them)
Well, I doubt that a 12 byte long double causes any other alignment but 4. -- Christian Tismer :^) <mailto:tis...@stackless.com> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/ 14109 Berlin : PGP key -> http://wwwkeys.pgp.net/ work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com