#include <cel_memory.h>
Public Member Functions | |
| virtual CEL_RESTRICT_RETVAL void * | allocate (size_t inBlockSize)=0 |
| virtual void | free (void *inMemoryBlockPtr)=0 |
| virtual | ~MemoryAllocator () |
Static Public Member Functions | |
| static MemoryAllocator * | getDefault () |
| static void | setDefault (MemoryAllocator *inAllocator) |
Definition at line 37 of file cel_memory.h.
| virtual Celartem::MemoryAllocator::~MemoryAllocator | ( | ) | [inline, virtual] |
Destuctor is virtual since this class defines the interface.
Definition at line 89 of file cel_memory.h.
| virtual CEL_RESTRICT_RETVAL void* Celartem::MemoryAllocator::allocate | ( | size_t | inBlockSize | ) | [pure virtual] |
This method allocates a memory block of the specified block size. By default, the behavior is identical to std::malloc.
| inBlockSize | Specifies the block size in bytes. |
| virtual void Celartem::MemoryAllocator::free | ( | void * | inMemoryBlockPtr | ) | [pure virtual] |
This method releases the specified memory block, which was allocated by allocate method. By default, the behavior is identical to std::free.
| inMemoryBlockPtr | Specifies the memory block to be released. |
Referenced by Celartem::SimpleArray< Celartem::AutoPtr< Celartem::Image > >::free().
| static MemoryAllocator* Celartem::MemoryAllocator::getDefault | ( | ) | [static] |
This function returns the default memory allocator.
Referenced by Celartem::SimpleArray< Celartem::AutoPtr< Celartem::Image > >::init().
| static void Celartem::MemoryAllocator::setDefault | ( | MemoryAllocator * | inAllocator | ) | [static] |
This function replaces the default memory allocator. Please note that you should call this function before calling any other function in this library. Replacing the default allocator after using some function of the library may break the consistency of the memory allocation and causes the serious runtime error.
| inAllocator | Pointer to the memory allocator. |