]> granicus.if.org Git - clang/commitdiff
Add some documentation stating that the memory allocated by the ASTContext.h placemen...
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Mon, 22 Sep 2014 02:26:17 +0000 (02:26 +0000)
committerEhsan Akhgari <ehsan.akhgari@gmail.com>
Mon, 22 Sep 2014 02:26:17 +0000 (02:26 +0000)
Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5392

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218232 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTContext.h

index 6b2a3bac3ff5c843beddb1e41445dde249084caa..4da5be876ac7641165f1ee787f0d62a4457b1585 100644 (file)
@@ -2355,9 +2355,9 @@ static inline Selector GetUnarySelector(StringRef name, ASTContext& Ctx) {
 /// // Specific alignment
 /// IntegerLiteral *Ex2 = new (Context, 4) IntegerLiteral(arguments);
 /// @endcode
-/// Please note that you cannot use delete on the pointer; it must be
-/// deallocated using an explicit destructor call followed by
-/// @c Context.Deallocate(Ptr).
+/// Memory allocated through this placement new operator does not need to be
+/// explicitly freed, as ASTContext will free all of this memory when it gets
+/// destroyed. Please note that you cannot use delete on the pointer.
 ///
 /// @param Bytes The number of bytes to allocate. Calculated by the compiler.
 /// @param C The ASTContext that provides the allocator.
@@ -2392,9 +2392,9 @@ inline void operator delete(void *Ptr, const clang::ASTContext &C, size_t) {
 /// // Specific alignment
 /// char *data = new (Context, 4) char[10];
 /// @endcode
-/// Please note that you cannot use delete on the pointer; it must be
-/// deallocated using an explicit destructor call followed by
-/// @c Context.Deallocate(Ptr).
+/// Memory allocated through this placement new[] operator does not need to be
+/// explicitly freed, as ASTContext will free all of this memory when it gets
+/// destroyed. Please note that you cannot use delete on the pointer.
 ///
 /// @param Bytes The number of bytes to allocate. Calculated by the compiler.
 /// @param C The ASTContext that provides the allocator.