Phoenix
Object-oriented orthogonally persistent operating system
|
Memory allocation operators. More...
Go to the source code of this file.
Defines | |
#define | NEW ::new(__FILE__, __LINE__) |
Macro to use operator new is required. | |
#define | NEW_ALIGNED(align) ::new(__FILE__, __LINE__, align) |
Macro for allocating aligned memory. | |
#define | NEW_OPT(...) ::new(__FILE__, __LINE__, ## __VA_ARGS__) |
Macro for allocating memory with options. | |
#define | DELETE ::delete |
Macro for invoking delete operator. | |
Functions | |
void * | __operator_new (size_t size, const char *file, int line, bool isArray=false, size_t align=0) |
Back-end for operator new which should be implemented by each environment. | |
void * | __operator_new (size_t size, bool isArray=false, size_t align=0) |
Back-end for operator new which should be implemented by each environment. | |
void | __operator_delete (void *ptr, bool isArray=false) |
Back-end for operator delete which should be implemented by each environment. | |
void * | operator new (size_t size) |
new operator for untracked allocations. | |
void * | operator new[] (size_t size) |
new operator for untracked arrays allocations. | |
void * | operator new (size_t size, size_t align) |
new operator for untracked allocations with options. | |
void * | operator new[] (size_t size, size_t align) |
new operator for untracked arrays allocations with options. | |
void * | operator new (size_t size, const char *file, int line, size_t align=0) |
new operator for tracked allocations with options. | |
void * | operator new[] (size_t size, const char *file, int line, size_t align=0) |
new operator for tracked arrays allocations with options. | |
void | operator delete (void *ptr) |
delete operator for non-arrays allocations. | |
void | operator delete[] (void *ptr) |
delete operator for arrays allocations. |
Memory allocation operators.
#define DELETE ::delete |
Macro for invoking delete operator.
#define NEW ::new(__FILE__, __LINE__) |
Macro to use operator new is required.
It will ensure allocations tracking in debug builds.
#define NEW_ALIGNED | ( | align | ) | ::new(__FILE__, __LINE__, align) |
Macro for allocating aligned memory.
align | Memory block alignment in bytes. |
#define NEW_OPT | ( | ... | ) | ::new(__FILE__, __LINE__, ## __VA_ARGS__) |
Macro for allocating memory with options.
void __operator_delete | ( | void * | ptr, |
bool | isArray = false |
||
) |
Back-end for operator delete which should be implemented by each environment.
ptr | Pointer to the memory block being freed. |
isArray | true if delete[] operator was invoked, false otherwise. |
void* __operator_new | ( | size_t | size, |
bool | isArray = false , |
||
size_t | align = 0 |
||
) |
Back-end for operator new which should be implemented by each environment.
This version is invoked in release builds.
size | Allocation size. |
isArray | true if new[] operator was invoked, false otherwise. |
align | Alignment value. Zero indicates that no specific alignment required. |
void* __operator_new | ( | size_t | size, |
const char * | file, | ||
int | line, | ||
bool | isArray = false , |
||
size_t | align = 0 |
||
) |
Back-end for operator new which should be implemented by each environment.
This version is invoked in debug builds with source code location in arguments.
size | Allocation size. |
file | Source file name where from the operator is invoked. |
line | Line number in the source file where from the operator is invoked. |
isArray | true if new[] operator was invoked, false otherwise. |
align | Alignment value. Zero indicates that no specific alignment required. |
void operator delete | ( | void * | ptr | ) | [inline] |
delete operator for non-arrays allocations.
ptr | Pointer to memory block to free. |
void operator delete[] | ( | void * | ptr | ) | [inline] |
delete operator for arrays allocations.
ptr | Pointer to memory block to free. |
void* operator new | ( | size_t | size, |
const char * | file, | ||
int | line, | ||
size_t | align = 0 |
||
) | [inline] |
new operator for tracked allocations with options.
size | Allocation size. |
file | Source file name where from the operator is invoked. |
line | Line number in the source file where from the operator is invoked. |
align | Alignment value. Zero indicates that no specific alignment required. |
void* operator new | ( | size_t | size | ) | [inline] |
new operator for untracked allocations.
size | Allocation size. |
void* operator new | ( | size_t | size, |
size_t | align | ||
) | [inline] |
new operator for untracked allocations with options.
size | Allocation size. |
align | Alignment value. Zero indicates that no specific alignment required. |
void* operator new[] | ( | size_t | size, |
size_t | align | ||
) | [inline] |
new operator for untracked arrays allocations with options.
size | Allocation size. |
align | Alignment value. Zero indicates that no specific alignment required. |
void* operator new[] | ( | size_t | size, |
const char * | file, | ||
int | line, | ||
size_t | align = 0 |
||
) | [inline] |
new operator for tracked arrays allocations with options.
size | Allocation size. |
file | Source file name where from the operator is invoked. |
line | Line number in the source file where from the operator is invoked. |
align | Alignment value. Zero indicates that no specific alignment required. |
void* operator new[] | ( | size_t | size | ) | [inline] |
new operator for untracked arrays allocations.
size | Allocation size. |