#include <TaskAllocatorPool.hh>
Definition at line 41 of file TaskAllocatorPool.hh.
◆ TaskAllocatorPool()
TaskAllocatorPool::TaskAllocatorPool |
( |
unsigned int |
n = 0 | ) |
|
|
explicit |
Definition at line 37 of file TaskAllocatorPool.cc.
38: esize((sz < sizeof(PoolLink)) ? sizeof(PoolLink) : sz)
39, csize((sz < 1024 / 2 - 16) ? (1024 - 16) : (sz * 10 - 16))
40, chunks(nullptr)
41, head(nullptr)
42, nchunks(0)
43{}
◆ ~TaskAllocatorPool()
TaskAllocatorPool::~TaskAllocatorPool |
( |
| ) |
|
◆ Alloc()
void * PTL::TaskAllocatorPool::Alloc |
( |
| ) |
|
|
inline |
Definition at line 112 of file TaskAllocatorPool.hh.
113{
114 if(head == nullptr)
115 Grow();
116 PoolLink* p = head;
117 head = p->next;
118 return p;
119}
◆ Free()
void PTL::TaskAllocatorPool::Free |
( |
void * |
b | ) |
|
|
inline |
Definition at line 126 of file TaskAllocatorPool.hh.
127{
128 PoolLink* p = static_cast<PoolLink*>(b);
129 p->next = head;
130 head = p;
131}
◆ GetNoPages()
int PTL::TaskAllocatorPool::GetNoPages |
( |
| ) |
const |
|
inline |
◆ GetPageSize()
unsigned int PTL::TaskAllocatorPool::GetPageSize |
( |
| ) |
const |
|
inline |
◆ GrowPageSize()
void PTL::TaskAllocatorPool::GrowPageSize |
( |
unsigned int |
factor | ) |
|
|
inline |
◆ Reset()
void TaskAllocatorPool::Reset |
( |
| ) |
|
Definition at line 83 of file TaskAllocatorPool.cc.
84{
85
86
87 PoolChunk*
n = chunks;
88 PoolChunk* p = nullptr;
89 while(n)
90 {
93 delete p;
94 }
95 head = nullptr;
96 chunks = nullptr;
97 nchunks = 0;
98}
Referenced by ~TaskAllocatorPool().
◆ Size()
unsigned int PTL::TaskAllocatorPool::Size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: