[Python-ideas] improving C structs layout

Antoine Pitrou solipsis at pitrou.net
Wed May 8 15:52:51 CEST 2013


On Wed, 08 May 2013 15:45:09 +0200
Alfredo Solano <asolano at icai.es> wrote:
> Hi,
> 
> Interesting observation, but isn't C struct alignment platform/compiler
> dependent?

The ABIs are standardized, so I would answer no.

Even if they weren't, there are common sense rules to minimize padding,
such as to put fields of the same width next to each other (e.g. put
chars together instead of intermingling them with ints and floats).

Regards

Antoine.





More information about the Python-ideas mailing list