...
Furthermore, the array form of the non-placement new
expression may increase the amount of storage it attempts to obtain by invoking the corresponding allocation function by an unspecified amount. This amount, referred to as overhead in the C++ standard, is commonly known as a cookie. The cookie is used to store the number of elements in the array so that the array delete expression or the exception unwinding mechanism can invoke the type's destructor on each successfully constructed element of the array. While the specific conditions under which the cookie is required by the array new expression aren't described in the C++ standard, they may be outlined in other specifications such as the application binary interface (ABI) document for the target environment. For example, the Itanium C++ ABI describes the rules for computing the size of a cookie, its location, and achieving the correct alignment of the array elements. When these rules require that a cookie be created, it is possible to obtain a suitably aligned array of elements of an overaligned type [CodeSourcery 2016a]. However, the rules are complex and the Itanium C++ ABI isn't universally applicable.
...
[ISO/IEC 14882-2014] | Subclause 3.7.4, "Dynamic Storage Duration" |
[Array New CookiesCodeSourcery 2016a] | Itanium C++ ABI, version 1.86 |
[N3396INCITS 2012] | Dynamic memory allocation for over-aligned data, WG14 proposal |
...