An array is aligned on natural boundaries if all of its elements are so aligned.Īll data items whose starting address is on a natural boundary are naturally aligned. For example, a REAL (KIND=8) data item aligned on natural boundaries has an address that is a multiple of 8. A natural boundary is a memory address that is a multiple of the data item's size. Those that are parameters passed on the stackįor best performance, align data as follows:Īlign 16-bit data to be contained within an aligned four byte word.Īlign 32-bit data so that its base address is a multiple of four.Īlign 64-bit data so that its base address is a multiple of eight.Īlign 128-bit data so that its base address is a multiple of sixteen (8-byte boundaries).Ĭauses of Unaligned Data and Ensuring Natural Alignmentįor optimal performance, make sure your data is aligned naturally. Those that are members of a data structure (Dynamically allocated data allocated with ALLOCATE is 8-byte aligned.) Setting Data Type and Alignment Setting Data Type and AlignmentĪlignment of data affects these kinds of variables:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |