Content deleted Content added
Wikikash98 (talk | contribs) I started a section on Security of placement new expression. Added couple of citations on the same. |
Wikikash98 (talk | contribs) m Updated the section on security and corrected a date error on [16] citation |
||
Line 229:
</syntaxhighlight>
This is why the ''pointer placement'' delete functions are defined as no-operations by the Standard C++ library. Since the pointer placement new functions do not allocate any storage, there is no storage to <ref name=":0">{{Cite journal|last=Kundu|first=Ashish|last2=Bertino|first2=Elisa|date=June 2011
If no matching placement delete function exists, no deallocation function is called in the event of an exception being thrown by a constructor within a placement <code>new</code> expression. There are also some (older) C++ implementations that do not support placement delete (which, like the exception-throwing allocator functions, were an addition made to C++ when it was standardized) at all. In both such situations, an exception being thrown by a constructor when allocating using a custom allocator will result in a memory leak. (In the case of the older C++ implementations, a memory leak will also occur with ''non-''placement <code>new</code> expressions.)<ref name=Meyers1998 /><ref name=Anderson1998b />
== Security ==
Placement new expressions
== Notes ==
|