Overloaded new/delete operators.
More...
#include <memory_allocation.h>
Overloaded new/delete operators.
Classes that derive from this class will use the EMBB methods for dynamic allocation and deallocation of memory (Allocation::Allocate() and Allocation::Free()). In debug mode, memory consumption is tracked in order to detect memory leaks.
- See also
- CacheAlignedAllocatable
static void* embb::base::Allocatable::operator new |
( |
size_t |
size | ) |
|
|
static |
New operator.
Allocates size
bytes of memory. Must not be called directly!
- Returns
- Pointer to allocated block of memory
- Exceptions
-
- Concurrency
- Thread-safe
- Dynamic memory allocation
- See Allocation::Allocate()
- See also
- operator delete()
- Parameters
-
[in] | size | Size of the memory block in bytes |
static void embb::base::Allocatable::operator delete |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
static |
Delete operator.
Deletes size
bytes of memory pointed to by ptr
. Must not be called directly!
- Concurrency
- Thread-safe
- See also
- operator new()
- Parameters
-
[in,out] | ptr | Pointer to memory block to be freed |
[in] | size | Size of the memory block in bytes |
static void* embb::base::Allocatable::operator new[] |
( |
size_t |
size | ) |
|
|
static |
Array new operator.
Allocates an array of size
bytes. Must not be called directly!
- Returns
- Pointer to allocated block of memory
- Concurrency
- Thread-safe
- Dynamic memory allocation
- See Allocation::Allocate()
- Exceptions
-
- See also
- operator delete[]()
- Parameters
-
[in] | size | Size of the array in bytes |
static void embb::base::Allocatable::operator delete[] |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
static |
Array delete operator.
Deletes array of size
bytes pointed to by ptr
. Must not be called directly!
- Concurrency
- Thread-safe
- See also
- operator new[]()
- Parameters
-
[in,out] | ptr | Pointer to the array to be freed |
[in] | size | Size of the array in bytes |