Allocating and Freeing Aligned Memory Blocks
To allocate and free aligned blocks of memory use the
_mm_freeintrinsics. These intrinsics are based on
free, which are in the
libirc.alibrary. You need to include
malloc.h. The syntax for these intrinsics is as follows:
void* _mm_malloc (size_t size, size_t align )
void _mm_free (void *p)
_mm_mallocroutine takes an extra parameter, which is the alignment constraint. This constraint must be a power of two. The pointer that is returned from
_mm_mallocis guaranteed to be aligned on the specified boundary.
Memory that is allocated using
_mm_mallocmust be freed using
freeon memory allocated with
_mm_freeon memory allocated with
mallocwill cause unpredictable behavior.