HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_Align.h File Reference
#include <stdlib.h>
+ Include dependency graph for SYS_Align.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SYS_ALIGN16
 
#define SYS_ALIGN(b)
 

Functions

voidSYSamalloc (size_t b)
 
voidSYSacalloc (size_t n, size_t b)
 
void SYSafree (void *p)
 
voidSYSamalloc (size_t b, size_t)
 

Macro Definition Documentation

#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.

Function Documentation

void* SYSacalloc ( size_t  n,
size_t  b 
)
inline

Definition at line 104 of file SYS_Align.h.

void SYSafree ( void p)
inline

Definition at line 105 of file SYS_Align.h.

void* SYSamalloc ( size_t  b)
inline

Definition at line 103 of file SYS_Align.h.

void* SYSamalloc ( size_t  b,
size_t   
)
inline

Definition at line 106 of file SYS_Align.h.