spot 2.3.1

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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:

## 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:

- spot/misc/fixpool.hh

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.