![]() |
Polygon Crucher SDK - Documentation
Documentation
|
definitions of macros for SDK new / delete / allocation operators. More...
definitions of macros for SDK new / delete / allocation operators.
#include <assert.h>
Go to the source code of this file.
Macros | |||||||
#define | xAllocateFunc(p_type, xfunc) (p_type *)mootools::xfunc(sizeof(p_type)) | ||||||
#define | xDeallocateFunc(p_pointer, xfunc) mootools::xfunc(p_pointer) | ||||||
#define | xAllocateArrayFunc(p_type, p_count, xfunc) (p_type *)mootools::xfunc(sizeof(p_type), p_count) | ||||||
#define | xDeallocateArrayFunc(p_pointer, p_count, xfunc) mootools::xfunc(p_pointer, p_count) | ||||||
Simple memory block allocation | |||||||
| |||||||
#define | xAllocate(p_type) xAllocateFunc(p_type, xmalloc) | ||||||
#define | xDeallocate(p_pointer, xfunc) xDeallocateFunc(p_type, xfree) | ||||||
#define | xAllocateArray(p_type, p_count) xAllocateArrayFunc(p_type, p_count, xmalloc_array) | ||||||
#define | xDeallocateArray(p_pointer) xDeallocateArrayFunc(p_pointer, 1, xfree_array) | ||||||
In-place constructor / destructor | |||||||
| |||||||
#define | xConstruct(p_type, p_pointer) new (p_pointer)p_type | ||||||
#define | xConstructParams(p_type, p_pointer, ...) new (p_pointer)p_type(__VA_ARGS__) | ||||||
#define | xConstructArray(p_type, p_pointer, p_count) mootools::xTConstructArray<p_type>(p_pointer, p_count) | ||||||
#define | xDestroyArray(p_pointer, p_count) mootools::xTDestroyArray(p_pointer, p_count) | ||||||
#define | xDestroy(p_pointer) mootools::xTDestroy(p_pointer) | ||||||
Memory and inheritance | |||||||
xCast is used to correctly destroy the memory allocated by an object in case of multi inheritance
| |||||||
#define | xCast(p_pointer) mootools::xTCast(p_pointer) | ||||||
New and delete operators | |||||||
| |||||||
#define | xNew(p_type) xConstruct(p_type, (xAllocateFunc(p_type, xnew))) | ||||||
#define | xNewParams(p_type, ...) xConstructParams(p_type, xAllocateFunc(p_type, xnew), __VA_ARGS__) | ||||||
#define | xNewArray(p_type, p_count) xConstructArray(p_type, xAllocateArrayFunc(p_type, p_count, xnew_array), p_count) | ||||||
#define | xDelete(p_pointer) | ||||||
#define | xDeleteArray(p_pointer, p_count) | ||||||
Functions | |
Template functions for constructing and deleting objects | |
| |
template<typename T > | |
void | xTDestroy (T *p_pointer) |
template<typename T > | |
T * | xTConstructArray (T *p_pointer, size_t p_count) |
template<typename T > | |
void | xTDestroyArray (const T *p_pointer, size_t p_count) |
template<typename T > | |
void * | xTCast (T *p_pointer) |