MemoryLeakIndicator
|
Header for overloaded new and delete operator. More...
#include <new>
Go to the source code of this file.
Macros | |
#define | DEBUG_NEW new( __FILE__, __LINE__ ) |
Redefinition of the operator new. | |
#define | new DEBUG_NEW |
Redefinition of the operator new. | |
Functions | |
void * | debug_new (std::size_t size, const char *fileName, int line) |
void * | operator new (std::size_t size, const char *fileName, int line) |
void * | operator new[] (std::size_t size, const char *fileName, int line) |
void | debug_delete (void *ptr) |
void | operator delete (void *ptr) |
void | operator delete (void *, const char *, int) |
Header for overloaded new and delete operator.
Terms of License
This file is part of the MemoryLeakIndicator module.
MemoryLeakIndicator is free software:
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GNU Affero General Public License Usage
You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Please review the following information to ensure the GNU Affero General Public License requirements will be met: https://www.gnu.org/licenses/agpl-3.0.en.html .
#define DEBUG_NEW new( __FILE__, __LINE__ ) |
Redefinition of the operator new.
#define new DEBUG_NEW |
Redefinition of the operator new.
void debug_delete | ( | void * | ptr | ) |
Passed object will be deregistered in MemSpy::LeakMap when MemSpy::LeakMap instantiates and then removed from memory.
[in] | ptr | Pointer to the object to be deleted. |
void * debug_new | ( | std::size_t | size, |
const char * | fileName, | ||
int | line ) |
An object is instantiated and registered in MemSpy::LeakMap if MemSpy::LeakMap is instantiated. param[in] size The size of the object to instantiate. param[in] fileName The file name where 'new' was called. param[in] line The line number where 'new' was called.
void operator delete | ( | void * | , |
const char * | , | ||
int | ) |
This operator delete is not called, but is intended to suppress the following warning: warning C4291: 'void * operator new(size_t,const char *,int)': no matching operator delete found; memory will not be freed if initialization throws an exception
void operator delete | ( | void * | ptr | ) |
This operator delete deletes and deregisters an object in MemSpy::LeakMap when MemSpy::LeakMap instantiates.
[in] | ptr | Pointer to the object to be deleted. |
void * operator new | ( | std::size_t | size, |
const char * | fileName, | ||
int | line ) |
This operator new registers a new object in MemSpy::LeakMap via function debug_new (...) when MemSpy::LeakMap is instantiated. param[in] size The size of the object to instantiate. param[in] fileName The file name where 'new' was called. param[in] line The line number where 'new' was called.
void * operator new[] | ( | std::size_t | size, |
const char * | fileName, | ||
int | line ) |