nvwa::mem_pool_base Class Reference

Base class for memory pools. More...

#include <mem_pool_base.h>

Inheritance diagram for nvwa::mem_pool_base:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

Base class for memory pools.


Constructor & Destructor Documentation

nvwa::mem_pool_base::~mem_pool_base (  )  [virtual]

Empty base destructor.


Member Function Documentation

void * nvwa::mem_pool_base::alloc_sys ( size_t  size  )  [static]

Allocates memory from the run-time system.

Parameters:
size size of the memory to allocate in bytes
Returns:
pointer to allocated memory block if successful; or 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.

Parameters:
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 >.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated by  doxygen 1.6.2