LWN.net Logo

The Only Natural Alignment Is Byte Alignment

The Only Natural Alignment Is Byte Alignment

Posted May 16, 2012 10:33 UTC (Wed) by amonnet (subscriber, #54852)
In reply to: The Only Natural Alignment Is Byte Alignment by ldo
Parent article: Fixing the unfixable autofs ABI

Look's like many protocol (think IPv4, etc) have been carefully crafted to provide natural alignment bigger than a byte. No padding but a nice choice of field size and position.
Anyway, it's not as if 16, 32, 64, .. are just some random numbers.


(Log in to post comments)

The Only Natural Alignment Is Byte Alignment

Posted May 16, 2012 10:50 UTC (Wed) by amonnet (subscriber, #54852) [Link]

To make things clear, alignment paddings in protocol are called private/unused/future fields.

The Only Natural Alignment Is Byte Alignment

Posted May 16, 2012 12:15 UTC (Wed) by paulj (subscriber, #341) [Link]

Sure, but all the fields' positions are still explicitly specified independently of any alignment concerns. I.e. the fields may have been constructed with regard for alignment, however the protocol doesn't depend on any alignment concerns.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds