C++ 17 introduces __STDCPP_DEFAULT_NEW_ALIGNMENT__
which defines the guaranteed alignment when uses not new-extended operator new
. However, std::max_align_t
is 8 which means the maximum alignment of basic types is 8 and __STDCPP_DEFAULT_NEW_ALIGNMENT__
over-aligned. My question is why MSVC and other compilers want to over-aligned? Any instruction is being used underlying requires this over-aligned alignment?
Similar question was asked in the following link before:
However, the comments only mentions that
"Because types that require 16-byte alignment existed over a decade before C++'s default new provided a mechanism to explicitly request allocations of such alignments. In order to allow users to use such types, Microsoft decided to make their default allocator always return 16-byte-aligned pointers."
I am wondering what's the "such types" specifies in detail?