Nvwa  1.1
Classes | Public Member Functions | Static Public Member Functions | List of all members
nvwa::mem_pool_base Class Referenceabstract

Base class for memory pools. More...

#include <mem_pool_base.h>

Inheritance diagram for nvwa::mem_pool_base:
[legend]

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. More...
 

Static Public Member Functions

static void * alloc_sys (size_t size)
 Allocates memory from the run-time system. More...
 
static void dealloc_sys (void *ptr)
 Frees memory and returns it to the run-time system. More...
 

Detailed Description

Base class for memory pools.

Member Function Documentation

◆ alloc_sys()

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

Allocates memory from the run-time system.

Parameters
sizesize of the memory to allocate in bytes
Returns
pointer to allocated memory block if successful; or null if memory allocation fails

◆ dealloc_sys()

void nvwa::mem_pool_base::dealloc_sys ( void *  ptr)
static

Frees memory and returns it to the run-time system.

Parameters
ptrpointer to the memory block previously allocated

◆ recycle()

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: