ardour
|
#include <pool.h>
Public Member Functions | |
Pool (std::string name, unsigned long item_size, unsigned long nitems) | |
virtual | ~Pool () |
virtual void * | alloc () |
virtual void | release (void *) |
std::string | name () const |
guint | available () const |
guint | used () const |
guint | total () const |
Protected Attributes | |
RingBuffer< void * > | free_list |
a list of pointers to free items within block More... | |
std::string | _name |
Private Attributes | |
void * | block |
data storage area More... | |
A pool of data items that can be allocated, read from and written to without system memory allocation or locking.
Pool::Pool | ( | std::string | name, |
unsigned long | item_size, | ||
unsigned long | nitems | ||
) |
|
virtual |
Allocate an item's worth of memory in the Pool by taking one from the free list.
Reimplemented in CrossThreadPool, MultiAllocSingleReleasePool, and SingleAllocMultiReleasePool.
|
virtual |
Release an item's memory by writing its location to the free list
Reimplemented in MultiAllocSingleReleasePool, and SingleAllocMultiReleasePool.
|
protected |