spot  2.4
Classes | Public Member Functions | List of all members
spot::fixed_size_pool Class Reference

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

#include <spot/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

◆ fixed_size_pool()

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

Create a pool allocating objects of size bytes.

◆ ~fixed_size_pool()

spot::fixed_size_pool::~fixed_size_pool ( )
inline

Free any memory allocated by this pool.

Member Function Documentation

◆ allocate()

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

Allocate size bytes of memory.

◆ deallocate()

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 Wed Sep 6 2017 05:14:05 for spot by doxygen 1.8.13