-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
https://itanium-cxx-abi.github.io/cxx-abi/abi.html#array-cookies says:
Lines 2123 to 2127 in 7f36ec6
<li> No cookie is required if the array element type T has a trivial | |
destructor (12.4 [class.dtor]) | |
and the usual (array) deallocation function | |
(3.7.3.2 [basic.stc.dynamic.deallocation]) | |
function does not take two arguments. |
This is wrong since C++17, because T::operator new[](std::size_t, std::align_val_t)
has two parameters, but still needs a cookie unless T
has a trivial destructor. It might also be wrong for a C++20 destroying operator delete, but I haven't spent enough time thinking about that case.
The note is also outdated:
Lines 2130 to 2134 in 7f36ec6
(Note: if the usual array deallocation function takes two arguments, | |
then it is a member function whose second argument is of type size_t. | |
The standard guarantees (12.5 [class.free]) | |
that this function will be passed the | |
number of bytes allocated with the previous array new expression.) |
Since C++14 added sized deallocation there is a usual deallocation functions with two parameters that isn't a member function,
operator delete[](void*, std::size_t)
.Metadata
Metadata
Assignees
Labels
No labels