#include <LWPool.h>
Definition at line 24 of file LWPool.h.
◆ LWPool() [1/3]
LWPool::LWPool |
( |
unsigned |
chunksize | ) |
|
◆ ~LWPool()
◆ LWPool() [2/3]
◆ LWPool() [3/3]
LWPool::LWPool |
( |
unsigned |
chunksize, |
|
|
unsigned |
growsize |
|
) |
| |
|
private |
◆ acquire()
char* LWPool::acquire |
( |
| ) |
|
◆ acquireClean()
char * LWPool::acquireClean |
( |
| ) |
|
◆ belongsInArea()
bool LWPool::belongsInArea |
( |
char * |
, |
|
|
LWPoolArea * |
|
|
) |
| const |
|
private |
◆ chunkSize()
unsigned LWPool::chunkSize |
( |
| ) |
const |
|
inlineprivate |
◆ erase()
Definition at line 67 of file LWPool.cxx.
69 std::scoped_lock lock (
m_mutex);
71 char *
c =
reinterpret_cast<char*
>(
a);
◆ findArea()
Definition at line 131 of file LWPool.cxx.
139 std::lower_bound(
m_areas.begin(),
m_areas.end(),
reinterpret_cast<void*
>(
c));
141 assert(
a&&
a->belongsInArea(
c)&&
"Trying to release chunk back to a mem-pool from which it was never acquired");
142 assert(
reinterpret_cast<char*
>(
a)<
c&&
c<
reinterpret_cast<char*
>(
a)+
m_growsize);
◆ forceCleanupMotherPool()
void LWPool::forceCleanupMotherPool |
( |
| ) |
|
|
static |
◆ freeArea()
Definition at line 174 of file LWPool.cxx.
185 const unsigned nareasplusone(
m_areas.size()+1);
186 for (;
i<nareasplusone;++
i) {
191 const unsigned nareasminusone(nareasplusone-2);
192 if (
i<nareasminusone) {
194 for (
unsigned j=
i;j<nareasminusone;++j)
197 m_areas.resize(nareasminusone);
198 char *
c =
reinterpret_cast<char*
>(
a);
◆ getMemDishedOut()
long long LWPool::getMemDishedOut |
( |
| ) |
const |
Definition at line 96 of file LWPool.cxx.
97 std::scoped_lock lock (
m_mutex);
100 l +=
a->getMemDishedOut();
◆ getMemOwned()
long long LWPool::getMemOwned |
( |
| ) |
const |
◆ getMotherMemOwned()
long long LWPool::getMotherMemOwned |
( |
| ) |
|
|
static |
◆ getMotherPool()
LWPool * LWPool::getMotherPool |
( |
| ) |
|
|
staticprivate |
Definition at line 20 of file LWPool.cxx.
25 static constexpr
unsigned poolgrow = 16384+
extra;
26 static constexpr
unsigned motherpoolgrow = poolgrow*32+
extra;
◆ grow()
◆ growSize()
unsigned LWPool::growSize |
( |
| ) |
const |
|
inlineprivate |
◆ init()
◆ isMotherPool()
bool LWPool::isMotherPool |
( |
| ) |
const |
|
inlineprivate |
◆ operator=()
◆ release()
void LWPool::release |
( |
char * |
| ) |
|
◆ searchAcquire()
char * LWPool::searchAcquire |
( |
| ) |
|
|
private |
◆ m_areas
◆ m_chunksize
const unsigned LWPool::m_chunksize |
|
private |
◆ m_growsize
const unsigned LWPool::m_growsize |
|
private |
◆ m_likelyNonEmptyArea
◆ m_likelyReleaseArea
◆ m_mutex
std::mutex LWPool::m_mutex |
|
mutableprivate |
◆ m_nchunksPerArea
unsigned LWPool::m_nchunksPerArea |
|
private |
The documentation for this class was generated from the following files: