Re: Inquiry on Alignment Requirements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Rutkowski wrote:
__alignof__ seems like it might be of some help:
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Alignment.html#Alignment
But unfortunately it doesn't tell me what the _strictest_ alignment
rule is, which is what I need to know to write a generic memory
allocator.

I did a little bit of Googling and it seems that there is no defined standard here.

You might apply __alignof__ to a variable with "__attribute__ ((aligned)" in order to find out "the largest alignment which is ever used for any data type on the target machine you are compiling for":

http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Variable-Attributes.html#Variable-Attributes

Cheers,
Nicholas Sherlock


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux