地址按256对齐。用下面的跑一下即知:
for (size_t k = 0; k <= 512; ++k) {
char *tmp = (char *)k;
tmp = (char *)(((uintptr_t)tmp + 255) & ~255);
printf("%zu, %p\n", k, tmp);
}
地址对齐有个通用宏的,适用于2的幂的对齐
https://lists.kernelnewbies.org/pipermail/kernelnewbies/2013-November/009229.html
--
修改:z16166 FROM 222.129.205.*
FROM 222.129.205.*