Pool of previously allocated, but currently unused, items.
More...
#include <Buffer.hxx>
|
| size_t | total_size () |
| |
| template<class BufferType > |
| void | alloc (Buffer< BufferType > **result, Executable *flow=NULL) |
| | Get a free item out of the pool.
|
| |
| template<class BufferType > |
| void | alloc (BufferPtr< BufferType > *result) |
| | Get a free item out of the pool.
|
| |
| template<class BufferType > |
| void | alloc_async (Executable *flow) |
| | Get a free item out of the pool.
|
| |
| virtual size_t | free_items ()=0 |
| | Number of free items in the pool.
|
| |
| virtual size_t | free_items (size_t size)=0 |
| | Number of free items in the pool for a given allocation size.
|
| |
|
| template<class BufferType > |
| static void | alloc_async_init (BufferBase *base, Buffer< BufferType > **result) |
| | Cast the result of an asynchronous allocation and perform a placement new on it.
|
| |
|
| size_t | totalSize |
| | keep track of total allocated size of memory
|
| |
|
|
| DISALLOW_COPY_AND_ASSIGN (Pool) |
| |
Pool of previously allocated, but currently unused, items.
Definition at line 277 of file Buffer.hxx.
◆ Pool()
◆ ~Pool()
◆ alloc() [1/2]
template<class BufferType >
Get a free item out of the pool.
- Parameters
-
| result | pointer to a pointer to the result |
| flow | if !NULL, then the alloc call is considered async and will behave as if alloc_async() was called. |
Definition at line 292 of file Buffer.hxx.
◆ alloc() [2/2]
template<class BufferType >
| void Pool::alloc |
( |
BufferPtr< BufferType > * |
result | ) |
|
|
inline |
Get a free item out of the pool.
This is a synchronous call.
- Parameters
-
| result | Buffer pointer that will hold the result |
Definition at line 309 of file Buffer.hxx.
◆ alloc_async()
template<class BufferType >
Get a free item out of the pool.
- Parameters
-
Definition at line 319 of file Buffer.hxx.
◆ alloc_async_init()
template<class BufferType >
| static void Pool::alloc_async_init |
( |
BufferBase * |
base, |
|
|
Buffer< BufferType > ** |
result |
|
) |
| |
|
inlinestatic |
Cast the result of an asynchronous allocation and perform a placement new on it.
- Parameters
-
| base | untyped buffer |
| result | pointer to a pointer to the cast result |
Definition at line 331 of file Buffer.hxx.
◆ alloc_untyped()
Untyped buffer allocation method, used be descendants.
- Parameters
-
| size | isthe number of bytes the buffer should have as payload. |
| flow | is non-null, then asynchronous allocation is performed and the flow is called with the new buffer when it is available. |
- Returns
- the new buffer or nullptr if out of RAM and async allocation was allowed.
Implemented in DynamicPool, FixedPool, DataBufferPool, and LimitedPool.
◆ free()
◆ free_items() [1/2]
| virtual size_t Pool::free_items |
( |
| ) |
|
|
pure virtual |
◆ free_items() [2/2]
| virtual size_t Pool::free_items |
( |
size_t |
size | ) |
|
|
pure virtual |
◆ total_size()
| size_t Pool::total_size |
( |
| ) |
|
|
inline |
- Returns
- the total memory held by this pool.
Definition at line 281 of file Buffer.hxx.
◆ Buffer
◆ BufferBase
◆ DataBufferPool
◆ LimitedPool
◆ totalSize
keep track of total allocated size of memory
Definition at line 377 of file Buffer.hxx.
The documentation for this class was generated from the following file: