windows下有现成的函数:_align_malloc, _align_realloc, _align_free,_align_offset_malloc,_aligned_offset_realloc
见
http://msdn.microsoft.com/zh-tw/data/8z34s9c6
以及
http://msdn.microsoft.com/zh-tw/data/fs9stz4e
下面是一个测试:
http://wenku.baidu.com/view/223fb6737fd5360cba1adba5.html
// crt_aligned_malloc.c
#include <malloc.h>
#include <stdio.h>
int main() {
void *ptr;
size_t align