VLink  2.3.0
A high-performance communication middleware
vlink::zerocopy::FastBufferPool类 参考final

Owns a fixed set of equally sized allocations and recycles them in round-robin order. 更多...

#include <fast_buffer_pool.h>

vlink::zerocopy::FastBufferPool 的协作图:

Public 成员函数

 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. 更多...
 
bool acquire (FastBuffer &buffer) noexcept
 Clears buffer and retains the next slot that no local holder or live importer references. 更多...
 
size_t depth () const noexcept
 Returns the slot count. 更多...
 
size_t size () const noexcept
 Returns the byte count of every slot. 更多...
 
void clear () noexcept
 Releases the pool's slot references. 更多...
 

详细描述

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.

参数
bufferOutput reference; empty when no slot is reusable.
返回
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.

参数
sizeNonzero byte count of every slot.
depthNonzero slot count.
configMemory type and provider-local device shared by every slot.
返回
Whether every slot was allocated.

◆ depth()

size_t vlink::zerocopy::FastBufferPool::depth ( ) const
inlinenoexcept

Returns the slot count.

返回
Zero before create().

◆ size()

size_t vlink::zerocopy::FastBufferPool::size ( ) const
inlinenoexcept

Returns the byte count of every slot.

返回
Zero before create().

该类的文档由以下文件生成: