Overloaded new/delete operators.
More...
#include <new>
#include <libutl/gblnew_macros.h>
Go to the source code of this file.
Overloaded new/delete operators.
In DEBUG
mode, the overloaded new and delete operators do extra checking to help identify common memory allocation mistakes for you (such as memory leaks). To have memory leaks reported, simply call memReportLeaks() just before your program exits.
- Author
- Adam McKee
Definition in file gblnew.h.
◆ operator new[]() [1/2]
void* operator new[] |
( |
size_t |
size | ) |
|
Overloaded operator new[].
- Returns
- address of allocated block
- Parameters
-
◆ operator delete[]() [1/2]
void operator delete[] |
( |
void * |
ptr | ) |
|
|
noexcept |
Overloaded operator delete[].
- Parameters
-
ptr | address of block to be freed |
◆ operator new[]() [2/2]
void* operator new[] |
( |
size_t |
size, |
|
|
const char * |
file, |
|
|
uint_t |
line |
|
) |
| |
Overloaded operator new[].
- Returns
- address of allocated block
- Parameters
-
size | block size in bytes |
file | name of file where block was allocated |
line | line number within file where block was allocated |
◆ operator delete[]() [2/2]
void operator delete[] |
( |
void * |
ptr, |
|
|
const char * |
file, |
|
|
uint_t |
line |
|
) |
| |
|
noexcept |
Overloaded operator delete[] (with file and line number info).
- Parameters
-
ptr | block address |
file | name of file where block was allocated |
line | line number within file where block was allocated |
◆ operator new() [1/2]
void* operator new |
( |
size_t |
size | ) |
|
Overloaded operator new.
- Returns
- address of allocated block
- Parameters
-
◆ operator delete() [1/2]
void operator delete |
( |
void * |
ptr | ) |
|
|
noexcept |
Overloaded operator delete.
- Parameters
-
◆ operator new() [2/2]
void* operator new |
( |
size_t |
size, |
|
|
const char * |
file, |
|
|
uint_t |
line |
|
) |
| |
Overloaded operator new (with file and line number info).
- Returns
- address of allocated block
- Parameters
-
size | block size in bytes |
file | name of file where block was allocated |
line | line number within file where block was allocated |
◆ operator delete() [2/2]
void operator delete |
( |
void * |
ptr, |
|
|
const char * |
file, |
|
|
uint_t |
line |
|
) |
| |
|
noexcept |
Overloaded operator delete (with file and line number info).
- Parameters
-
ptr | block address |
file | name of file where block was allocated |
line | line number within file where block was allocated |