Base class for memory pools. More...
#include <mem_pool_base.h>
Classes | |
struct | _Block_list |
Structure to store the next available memory block. More... | |
Public Member Functions | |
virtual | ~mem_pool_base () |
Empty base destructor. | |
virtual void | recycle ()=0 |
Recycles unused memory from memory pools. | |
Static Public Member Functions | |
static void * | alloc_sys (size_t size) |
Allocates memory from the run-time system. | |
static void | dealloc_sys (void *ptr) |
Frees memory and returns it to the run-time system. |
Base class for memory pools.
nvwa::mem_pool_base::~mem_pool_base | ( | ) | [virtual] |
Empty base destructor.
void * nvwa::mem_pool_base::alloc_sys | ( | size_t | size | ) | [static] |
Allocates memory from the run-time system.
size | size of the memory to allocate in bytes |
NULL
if memory allocation fails void nvwa::mem_pool_base::dealloc_sys | ( | void * | ptr | ) | [static] |
Frees memory and returns it to the run-time system.
ptr | pointer to the memory block previously allocated |
void nvwa::mem_pool_base::recycle | ( | ) | [pure virtual] |
Recycles unused memory from memory pools.
It is an interface and needs to be implemented in subclasses.
Implemented in nvwa::static_mem_pool< _Sz, _Gid >.