|
GNU Radio 3.6.1 C++ API
|
very simple thread-safe fixed-size allocation pool More...
#include <pmt_pool.h>
Classes | |
| struct | item |
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) |
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.
| pmt::pmt_pool::pmt_pool | ( | size_t | itemsize, |
| size_t | alignment = 16, |
||
| size_t | allocation_size = 4096, |
||
| size_t | max_items = 0 |
||
| ) |
| itemsize | size in bytes of the items to be allocated. |
| alignment | alignment in bytes of all objects to be allocated (must be power-of-2). |
| allocation_size | number of bytes to allocate at a time from the underlying allocator. |
| max_items | is the maximum number of items to allocate. If this number is exceeded, the allocate blocks. 0 implies no limit. |
| pmt::pmt_pool::~pmt_pool | ( | ) |
| void* pmt::pmt_pool::malloc | ( | ) |