内存对齐
来源:互联网 发布:nagios下载 linux版本 编辑:程序博客网 时间:2024/06/11 23:20
转:http://bbs.chinaunix.net/thread-3766948-1-1.html
#define _ALLOC_ALIGN_SIZE 16 /* bytes */
#define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1))#define MEM_ROUND_UP(x) ROUND_UP(x, _ALLOC_ALIGN_SIZE)