Quantcast
Viewing latest article 11
Browse Latest Browse All 1257

Comment by HolyBlackCat on To obtain correctly aligned memory in the allocation of `std::vector`, does it matter what the choice of `T` is?

@user2138149 operator new returns memory aligned to __STDCPP_DEFAULT_NEW_ALIGNMENT__ (that's 16 on all platforms I just tested) if you don't specify alignment yourself. I think that even if you specify alignment, it will refuse to align to less than that amount, but it's not guaranteed anywhere as far as I can tell. In this case by "underaligned" I mean "aligned less than __STDCPP_DEFAULT_NEW_ALIGNMENT__", but I'm using the word loosely, the proper definition is probably "aligned less than alignof(std::max_align_t)".

Viewing latest article 11
Browse Latest Browse All 1257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>