Visual Studio 2022
-
64비트 시스템에서 메모리 정렬 경계에 대해개발/C·C++ 2024. 10. 11. 14:52
64bit 프로세서의 64bit 모드에서 메모리 동적할당을 하면 주소 값이 16바이트 정렬이 기본 값인 것 같다.struct PureNode{ int a; int b; int c;};int main(){ constexpr int ALIGN = 16; for (int i = 0; i (new PureNode()); uintptr_t node2 = reinterpret_cast(new PureNode()); uintptr_t node3 = reinterpret_cast(new PureNode()); uintptr_t node4 = reinterpret_cast(new PureNode()); uintptr_t node5 = reinterpret_cast(new PureNode()); ASSERT_C..