|
Krita Source Code Documentation
|
#include <kis_tile_data_pooler.h>
Inheritance diagram for KisTileDataPooler:Public Member Functions | |
| void | forceUpdateMemoryStats () |
| void | kick () |
| KisTileDataPooler (KisTileDataStore *store, qint32 memoryLimit=-1) | |
| qint64 | lastHistoricalMemoryMetric () const |
| qint64 | lastPoolMemoryMetric () const |
| qint64 | lastRealMemoryMetric () const |
| void | terminatePooler () |
| void | testingRereadConfig () |
| ~KisTileDataPooler () override | |
Protected Member Functions | |
| qint32 | canDonorMemory (KisTileData *td) |
| int | clonesMetric (KisTileData *td) |
| int | clonesMetric (KisTileData *td, int numClones) |
| void | cloneTileData (KisTileData *td, qint32 numClones) const |
| template<class Iter > | |
| void | getLists (Iter *iter, QList< KisTileData * > &beggars, QList< KisTileData * > &donors, qint32 &memoryOccupied, qint32 &statRealMemory, qint32 &statHistoricalMemory) |
| qint32 | needMemory (KisTileData *td) |
| qint32 | numClonesNeeded (KisTileData *td) const |
| bool | processLists (QList< KisTileData * > &beggars, QList< KisTileData * > &donors, qint32 &memoryOccupied) |
| void | run () override |
| void | tryFreeOrphanedClones (KisTileData *td) |
| qint32 | tryGetMemory (QList< KisTileData * > &donors, qint32 memoryMetric) |
| void | waitForWork () |
Protected Attributes | |
| bool | m_lastCycleHadWork |
| qint32 | m_lastHistoricalMemoryMetric |
| qint32 | m_lastPoolMemoryMetric |
| qint32 | m_lastRealMemoryMetric |
| qint32 | m_memoryLimit |
| QSemaphore | m_semaphore |
| QAtomicInt | m_shouldExitFlag |
| KisTileDataStore * | m_store |
| qint32 | m_timeout |
Static Protected Attributes | |
| static const qint32 | MAX_NUM_CLONES = 16 |
| static const qint32 | MAX_TIMEOUT = 60000 |
| static const qint32 | MIN_TIMEOUT = 100 |
| static const qint32 | TIMEOUT_FACTOR = 2 |
Private Member Functions | |
| void | debugTileStatistics () |
Definition at line 19 of file kis_tile_data_pooler.h.
| KisTileDataPooler::KisTileDataPooler | ( | KisTileDataStore * | store, |
| qint32 | memoryLimit = -1 ) |
Definition at line 80 of file kis_tile_data_pooler.cc.
References m_lastCycleHadWork, m_lastHistoricalMemoryMetric, m_lastPoolMemoryMetric, m_lastRealMemoryMetric, m_memoryLimit, m_shouldExitFlag, m_store, m_timeout, MiB_TO_METRIC(), and MIN_TIMEOUT.
|
override |
Definition at line 99 of file kis_tile_data_pooler.cc.
|
inlineprotected |
Definition at line 279 of file kis_tile_data_pooler.cc.
References KisTileData::age(), and clonesMetric().
|
inlineprotected |
Definition at line 260 of file kis_tile_data_pooler.cc.
References KisTileData::m_clonesStack, KisTileData::pixelSize(), and KisLocklessStack< T >::size().
|
inlineprotected |
Definition at line 256 of file kis_tile_data_pooler.cc.
References KisTileData::pixelSize().
|
protected |
Definition at line 127 of file kis_tile_data_pooler.cc.
References KisTileData::blockSwapping(), DEBUG_CLONE_ACTION, KisTileData::m_clonesStack, KisLocklessStack< T >::pop(), KisLocklessStack< T >::push(), and KisTileData::unblockSwapping().
|
private |
Assume we are called from the inside of the loop. This means m_store is already locked
Definition at line 388 of file kis_tile_data_pooler.cc.
References KisTileDataStore::beginIteration(), dbgKrita, KisTileDataStore::endIteration(), KisTileDataStoreIterator::hasNext(), KisTileData::m_clonesStack, m_store, KisTileDataStoreIterator::next(), KisTileDataStore::numTiles(), and KisLocklessStack< T >::size().
| void KisTileDataPooler::forceUpdateMemoryStats | ( | ) |
Is case the pooler thread is not running, the user might force recalculation of the memory statistics explicitly.
Definition at line 216 of file kis_tile_data_pooler.cc.
References KisTileDataStore::beginReverseIteration(), KisTileDataStore::endIteration(), getLists(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_lastHistoricalMemoryMetric, m_lastPoolMemoryMetric, m_lastRealMemoryMetric, and m_store.
|
protected |
Definition at line 285 of file kis_tile_data_pooler.cc.
References canDonorMemory(), clonesMetric(), DEBUG_LISTS, KisTileData::historical(), needMemory(), KisTileData::pixelSize(), and tryFreeOrphanedClones().
| void KisTileDataPooler::kick | ( | ) |
Definition at line 103 of file kis_tile_data_pooler.cc.
References m_semaphore.
| qint64 KisTileDataPooler::lastHistoricalMemoryMetric | ( | ) | const |
Definition at line 251 of file kis_tile_data_pooler.cc.
References m_lastHistoricalMemoryMetric.
| qint64 KisTileDataPooler::lastPoolMemoryMetric | ( | ) | const |
Definition at line 241 of file kis_tile_data_pooler.cc.
References m_lastPoolMemoryMetric.
| qint64 KisTileDataPooler::lastRealMemoryMetric | ( | ) | const |
Definition at line 246 of file kis_tile_data_pooler.cc.
References m_lastRealMemoryMetric.
|
inlineprotected |
Definition at line 273 of file kis_tile_data_pooler.cc.
References KisTileData::age(), clonesMetric(), and numClonesNeeded().
|
protected |
Definition at line 117 of file kis_tile_data_pooler.cc.
References KisTileData::m_clonesStack, KisTileData::m_usersCount, MAX_NUM_CLONES, RUNTIME_SANITY_CHECK, and KisLocklessStack< T >::size().
|
protected |
Definition at line 354 of file kis_tile_data_pooler.cc.
References clonesMetric(), cloneTileData(), DEBUG_ALLOC_CLONE, DEBUG_FREE_CLONE, m_memoryLimit, numClonesNeeded(), and tryGetMemory().
|
overrideprotected |
Definition at line 170 of file kis_tile_data_pooler.cc.
References KisTileDataStore::beginReverseIteration(), DEBUG_SIMPLE_ACTION, DEBUG_TILE_STATISTICS, KisTileDataStore::endIteration(), getLists(), m_lastCycleHadWork, m_lastHistoricalMemoryMetric, m_lastPoolMemoryMetric, m_lastRealMemoryMetric, m_memoryLimit, m_shouldExitFlag, m_store, processLists(), and waitForWork().
| void KisTileDataPooler::terminatePooler | ( | ) |
Definition at line 108 of file kis_tile_data_pooler.cc.
References kick(), and m_shouldExitFlag.
| void KisTileDataPooler::testingRereadConfig | ( | ) |
Definition at line 410 of file kis_tile_data_pooler.cc.
References m_memoryLimit, and MiB_TO_METRIC().
|
inlineprotected |
Definition at line 264 of file kis_tile_data_pooler.cc.
References cloneTileData(), and numClonesNeeded().
|
protected |
Definition at line 333 of file kis_tile_data_pooler.cc.
References clonesMetric(), cloneTileData(), KisTileData::m_clonesStack, and KisLocklessStack< T >::size().
|
protected |
Definition at line 150 of file kis_tile_data_pooler.cc.
References m_lastCycleHadWork, m_semaphore, m_timeout, MAX_TIMEOUT, MIN_TIMEOUT, and TIMEOUT_FACTOR.
|
protected |
Definition at line 81 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 85 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 83 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 84 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 82 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 77 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 78 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 79 of file kis_tile_data_pooler.h.
|
protected |
Definition at line 80 of file kis_tile_data_pooler.h.
|
staticprotected |
Definition at line 45 of file kis_tile_data_pooler.h.
|
staticprotected |
Definition at line 46 of file kis_tile_data_pooler.h.
|
staticprotected |
Definition at line 47 of file kis_tile_data_pooler.h.
|
staticprotected |
Definition at line 48 of file kis_tile_data_pooler.h.