Owns a fixed set of equally sized allocations and recycles them in round-robin order.
More...
#include <fast_buffer_pool.h>
|
| | FastBufferPool () noexcept=default |
| |
| | ~FastBufferPool () noexcept=default |
| |
| bool | create (size_t size, size_t depth, const FastBuffer::Config &config={}) noexcept |
| | Allocates depth buffers of size bytes; failure leaves the pool unchanged. More...
|
| |
| bool | acquire (FastBuffer &buffer) noexcept |
| | Clears buffer and retains the next slot that no local holder or live importer references. More...
|
| |
| size_t | depth () const noexcept |
| | Returns the slot count. More...
|
| |
| size_t | size () const noexcept |
| | Returns the byte count of every slot. More...
|
| |
| void | clear () noexcept |
| | Releases the pool's slot references. More...
|
| |
Owns a fixed set of equally sized allocations and recycles them in round-robin order.
◆ FastBufferPool()
| vlink::zerocopy::FastBufferPool::FastBufferPool |
( |
| ) |
|
|
defaultnoexcept |
◆ ~FastBufferPool()
| vlink::zerocopy::FastBufferPool::~FastBufferPool |
( |
| ) |
|
|
defaultnoexcept |
◆ acquire()
| bool vlink::zerocopy::FastBufferPool::acquire |
( |
FastBuffer & |
buffer | ) |
|
|
noexcept |
Clears buffer and retains the next slot that no local holder or live importer references.
- Parameters
-
| buffer | Output reference; empty when no slot is reusable. |
- Returns
- Whether a slot was acquired.
◆ clear()
| void vlink::zerocopy::FastBufferPool::clear |
( |
| ) |
|
|
noexcept |
Releases the pool's slot references.
◆ create()
| bool vlink::zerocopy::FastBufferPool::create |
( |
size_t |
size, |
|
|
size_t |
depth, |
|
|
const FastBuffer::Config & |
config = {} |
|
) |
| |
|
noexcept |
Allocates depth buffers of size bytes; failure leaves the pool unchanged.
- Parameters
-
| size | Nonzero byte count of every slot. |
| depth | Nonzero slot count. |
| config | Memory type and provider-local device shared by every slot. |
- Returns
- Whether every slot was allocated.
◆ depth()
| size_t vlink::zerocopy::FastBufferPool::depth |
( |
| ) |
const |
|
inlinenoexcept |
Returns the slot count.
- Returns
- Zero before
create().
◆ size()
| size_t vlink::zerocopy::FastBufferPool::size |
( |
| ) |
const |
|
inlinenoexcept |
Returns the byte count of every slot.
- Returns
- Zero before
create().
The documentation for this class was generated from the following file: