[Python-ideas] improving C structs layout

random832 at fastmail.us random832 at fastmail.us
Wed May 8 18:25:36 CEST 2013


On Wed, May 8, 2013, at 12:17, Andrew Barnert wrote:
> This is true... But you have to keep in mind that the width of different
> types is itself platform-dependent. If you've got an int, a long, a
> pointer, and a double, how do you pack them in a way that makes sense for
> all platforms, or even just the big 3 of x86_64 Mac/Linux/BSD, Win64, and
> Win32?

A double is always going to be at least 64 bits. A long is usually going
to be 32 or 64 bits. A pointer is usually going to be 32 or 64 bits, and
on win64 (the only common one where long and pointer are different),
long is 32 and pointer is 64. An int is usually 32 bits.



More information about the Python-ideas mailing list