What is structure alignment?
All modern CPUs expect that fundamental types, such as int’s long’s and float’s, are stored in memory at addresses that are multiples of their length. CPUs are optimized for accessing memory aligned in this way. Some CPUs (such as the Intel x86 series) allow unaligned access but at a performance penalty. Some CPUs trap unaligned accesses to the operating system where they can either be ignored, simulated or reported as errors. Other CPUs (just as the early ARM processors) use the unaligned address as a means to do special operations during the load or store. When a C compiler processes a strucure declaration, it can add extra bytes between the fields to ensure that all of them that require alignment are properly aligned. It will also ensure that instances of the structure as a whole are properly aligned when defined. It will add additional bytes to the end of a structure to ensure that arrays of the structure are properly aligned. “malloc” and friends always return memory pointers that
Related Questions
- In the Prime Comparative Modeling workflow, Edit Alignment stage, the secondary structure prediction fails. What should I do?
- Can Clustal-style progressive pairwise alignment of multiple sequences be used in RNA secondary structure prediction?
- how to disable structure alignment using gcc compiler options ?