Title
::operator delete[] requirement incorrect/insufficient
Status
cd1
Section
[new.delete.array]
Submitter
John A. Pedretti

Created on 2001-01-10.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change 18.5.1.2, p12 from

-12- Default behavior:

  • For a null value of ptr , does nothing.
  • Any other value of ptr shall be a value returned earlier by a call to the default operator new[](std::size_t). [Footnote: The value must not have been invalidated by an intervening call to operator delete[](void*) ([res.on.arguments]). --- end footnote] For such a non-null value of ptr , reclaims storage allocated by the earlier call to the default operator new[].

to

-12- Default behavior: Calls operator delete(ptr) or operator delete(ptr, std::nothrow) respectively.

and expunge paragraph 13.

Date: 2001-01-10.00:00:00

The default behavior of operator delete[] described in 18.5.1.2, p12 - namely that for non-null value of ptr, the operator reclaims storage allocated by the earlier call to the default operator new[] - is not correct in all cases. Since the specified operator new[] default behavior is to call operator new (18.5.1.2, p4, p8), which can be replaced, along with operator delete, by the user, to implement their own memory management, the specified default behavior of operator delete[] must be to call operator delete.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2154
2001-01-10 00:00:00admincreate