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, cache-aligned allocation and deallocation of memory (Allocation::AllocateCacheAligned() and Allocation::FreeAligned()). In debug mode, memory consumption is tracked in order to detect memory leaks.
- Note
- When using the new[] operator, not each object in the array is aligned, but only the constructed array as a whole.
- See also
- Allocatable
static void* embb::base::CacheAlignedAllocatable::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::AllocateCacheAligned()
- See also
- operator delete()
- Parameters
-
[in] | size | Size of the memory block in bytes |
static void embb::base::CacheAlignedAllocatable::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
- Parameters
-
[in,out] | ptr | Pointer to memory block to be freed |
[in] | size | Size of the memory block in bytes |
static void* embb::base::CacheAlignedAllocatable::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
- Exceptions
-
- Dynamic memory allocation
- See Allocation::AllocateCacheAligned()
- Concurrency
- Thread-safe
- See also
- operator delete[]()
- Parameters
-
[in] | size | size of bytes to allocate for the array |
static void embb::base::CacheAlignedAllocatable::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 |