spot  2.11.6
Classes | Public Member Functions | List of all members
spot::multiple_size_pool Class Reference

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

#include <spot/misc/mspool.hh>

Collaboration diagram for spot::multiple_size_pool:

Public Member Functions

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

Detailed Description

A multiple-size memory pool implementation.

Constructor & Destructor Documentation

◆ multiple_size_pool()

spot::multiple_size_pool::multiple_size_pool ( )
inline

Create a pool.

◆ ~multiple_size_pool()

spot::multiple_size_pool::~multiple_size_pool ( )
inline

Free any memory allocated by this pool.

Member Function Documentation

◆ allocate()

void* spot::multiple_size_pool::allocate ( size_t  size)
inline

Allocate size bytes of memory.

◆ deallocate()

void spot::multiple_size_pool::deallocate ( const void *  ptr,
size_t  size 
)
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 size argument should be the same as the one passed to allocate().


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 Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1