GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
pmt::pmt_pool Class Reference

very simple thread-safe fixed-size allocation pool More...

#include <pmt/pmt_pool.h>

Public Member Functions

 pmt_pool (size_t itemsize, size_t alignment=16, size_t allocation_size=4096, size_t max_items=0)
 
 ~pmt_pool ()
 
void * malloc ()
 
void free (void *p)
 

Detailed Description

very simple thread-safe fixed-size allocation pool

FIXME may want to go to global allocation with per-thread free list. This would eliminate virtually all lock contention.

Constructor & Destructor Documentation

◆ pmt_pool()

pmt::pmt_pool::pmt_pool ( size_t  itemsize,
size_t  alignment = 16,
size_t  allocation_size = 4096,
size_t  max_items = 0 
)
Parameters
itemsizesize in bytes of the items to be allocated.
alignmentalignment in bytes of all objects to be allocated (must be power-of-2).
allocation_sizenumber of bytes to allocate at a time from the underlying allocator.
max_itemsis the maximum number of items to allocate. If this number is exceeded, the allocate blocks. 0 implies no limit.

◆ ~pmt_pool()

pmt::pmt_pool::~pmt_pool ( )

Member Function Documentation

◆ free()

void pmt::pmt_pool::free ( void *  p)

◆ malloc()

void* pmt::pmt_pool::malloc ( )

The documentation for this class was generated from the following file: