Typically some character array is allocated on the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: type int, or any pointer, must be at an address having the low-order two bits equal to 0. Aside: Alignment with Microsoft Windows. Microsoft Windows requires a stronger alignment requirement—any -byte (primitive) object must have an address that is a multiple of . In particular, it requires that the address of a double be a multiple of 8. This requirement enhances the memory performance at the expense of some wasted space. The design decision made in Linux was probably good for the i386, back when memory was scarce and memory busses were only 4 bytes wide. With modern processors, Microsoft’s alignment is a better design decision. The command line flag -malign-double causes GCC on Linux to use 8-byte alignment for data of type double. This will lead to improved memory performance, but it can cause incompatibilities when linking with library code that has been compiled assuming a 4-byte alignment. End Aside. Alignment is enforced by making sure that every data type is organized and allocated in such a way that every object within the type satisfies its alignment rest...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online