Add some documentation stating that the memory allocated by the ASTContext.h placement new does not need to be explicitly freed

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 218232
This commit is contained in:
Ehsan Akhgari 2014-09-22 02:26:17 +00:00
parent cd1d79e77c
commit 75e8711d46
1 changed files with 6 additions and 6 deletions

View 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.