RTEMS Logo

RTEMS 4.6.99.3 On-Line Library


Code Tuning Parameters Heap Element Alignment

PREV UP NEXT Bookshelf RTEMS Porting Guide

9.4.2: Heap Element Alignment

The CPU_HEAP_ALIGNMENT macro is set to indicate the byte alignment requirement for data allocated by the RTEMS Code Heap Handler. This alignment requirement may be stricter than that for the data types alignment specified by CPU_ALIGNMENT. It is common for the heap to follow the same alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap, then this should be set to CPU_ALIGNMENT. This macro is necessary to ensure that allocated memory is properly aligned for use by high level language routines.

The following example illustrates how the CPU_HEAP_ALIGNMENT macro is set when the required alignment for elements from the heap is the same as the basic CPU alignment requirements.

#define CPU_HEAP_ALIGNMENT         CPU_ALIGNMENT

NOTE: This does not have to be a power of 2. It does have to be greater or equal to than CPU_ALIGNMENT.


PREV UP NEXT Bookshelf RTEMS Porting Guide

Copyright © 1988-2004 OAR Corporation