|
ClanLib
2.3.7
|
Class with operator new/delete overloads for CL_BlockAllocator. More...
#include <block_allocator.h>
Public Member Functions | |
Operations | |
| void * | operator new (size_t size, CL_BlockAllocator *allocator) |
| void | operator delete (void *data, size_t size) |
| void | operator delete (void *data, CL_BlockAllocator *allocator) |
Class with operator new/delete overloads for CL_BlockAllocator.
To use this class, derive your class from CL_BlockAllocated. Then, to allocate your class, use the following operator new syntax:
CL_BlockAllocator allocator;
MyObject *obj = new(&allocator) MyObject(..);
Before freeing up the memory using CL_BlockAllocator::free() you have to delete the object first using operator delete. If you fail to do this the destructor will not get called.
| void CL_BlockAllocated::operator delete | ( | void * | data, |
| size_t | size | ||
| ) |
| void CL_BlockAllocated::operator delete | ( | void * | data, |
| CL_BlockAllocator * | allocator | ||
| ) |
| void* CL_BlockAllocated::operator new | ( | size_t | size, |
| CL_BlockAllocator * | allocator | ||
| ) |
1.8.4