spot  2.11.6
Classes | Public Member Functions | List of all members
spot::fixed_size_pool< Kind > Class Template Reference

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

#include <spot/misc/fixpool.hh>

Inheritance diagram for spot::fixed_size_pool< Kind >:
Collaboration diagram for spot::fixed_size_pool< Kind >:

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 (void *ptr)
 Recycle size bytes of memory. More...
 

Detailed Description

template<pool_type Kind>
class spot::fixed_size_pool< Kind >

A fixed-size memory pool implementation.

Constructor & Destructor Documentation

◆ fixed_size_pool()

template<pool_type Kind>
spot::fixed_size_pool< Kind >::fixed_size_pool ( size_t  size)
inline

Create a pool allocating objects of size bytes.

◆ ~fixed_size_pool()

template<pool_type Kind>
spot::fixed_size_pool< Kind >::~fixed_size_pool ( )
inline

Free any memory allocated by this pool.

Member Function Documentation

◆ allocate()

template<pool_type Kind>
void* spot::fixed_size_pool< Kind >::allocate ( )
inline

Allocate size bytes of memory.

◆ deallocate()

template<pool_type Kind>
void spot::fixed_size_pool< Kind >::deallocate ( 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 Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1