HDK
|
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | SYS_ALIGN16 |
#define | SYS_ALIGN(b) |
Functions | |
void * | SYSamalloc (size_t b) |
void * | SYSacalloc (size_t n, size_t b) |
void | SYSafree (void *p) |
void * | SYSamalloc (size_t b, size_t) |
#define SYS_ALIGN | ( | b | ) |
Definition at line 101 of file SYS_Align.h.
#define SYS_ALIGN16 |
These definitions are system specific methods of forcing data to be aligned. Some processors require data to be aligned on 16 byte boundaries for certain operations. These macros and inline functions provide a consistent approach to doing this.
Example 1: class Foo { SYS_ALIGN16 int a[4]; int b; SYS_ALIGN16 char c; }; In the struct, both the A and C members will be aligned on a 16 byte boundary. This will force the size of the class to be 48 bytes.
Example 2: fpreal32 *list = SYSamalloc(4*sizeof(fpreal32)); This will guarantee that the list pointer is aligned on a 16 byte boundary.
Example 3: fpreal32 *list = SYSamalloc(4*sizeof(fpreal32), 128); This will guarantee that the list is aligned to a 128 byte boundary.
Definition at line 100 of file SYS_Align.h.
|
inline |
Definition at line 104 of file SYS_Align.h.
Definition at line 105 of file SYS_Align.h.
|
inline |
Definition at line 103 of file SYS_Align.h.
|
inline |
Definition at line 106 of file SYS_Align.h.