spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | List of all members
spot::fixed_size_pool Class Reference

A fixed-size memory pool implementation. More...

#include <misc/fixpool.hh>

Collaboration diagram for spot::fixed_size_pool:
Collaboration graph

Public Member Functions

 fixed_size_pool (size_t size)
 Create a pool allocating objects of size bytes. More...
 
 ~fixed_size_pool ()
 Free any memory allocated by this pool. More...
 
void * allocate ()
 Allocate size bytes of memory. More...
 
void deallocate (const void *ptr)
 Recycle size bytes of memory. More...
 

Detailed Description

A fixed-size memory pool implementation.

Constructor & Destructor Documentation

spot::fixed_size_pool::fixed_size_pool ( size_t  size)
inline

Create a pool allocating objects of size bytes.

spot::fixed_size_pool::~fixed_size_pool ( )
inline

Free any memory allocated by this pool.

Member Function Documentation

void* spot::fixed_size_pool::allocate ( )
inline

Allocate size bytes of memory.

void spot::fixed_size_pool::deallocate ( const void *  ptr)
inline

Recycle size bytes of memory.

Despite the name, the memory is not really deallocated in the "delete" sense: it is still owned by the pool and will be reused by allocate as soon as possible. The memory is only freed when the pool is destroyed.


The documentation for this class was generated from the following file:

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:44 for spot by doxygen 1.8.4