/** * An implementation of Discardable Memory that manages a fixed-size * budget of memory. When the allocated memory exceeds this size, * unlocked blocks of memory are purged. If all memory is locked, it * can exceed the memory-use budget.
*/ class SkDiscardableMemoryPool : public SkDiscardableMemory::Factory { public: virtual size_t getRAMUsed() = 0; virtualvoid setRAMBudget(size_t budget) = 0; virtual size_t getRAMBudget() = 0;
/** purges all unlocked DMs */ virtualvoid dumpPool() = 0;
#if SK_LAZY_CACHE_STATS /** * These two values are a count of the number of successful and * failed calls to SkDiscardableMemory::lock() for all DMs managed * by this pool.
*/ virtualint getCacheHits() = 0; virtualint getCacheMisses() = 0; virtualvoid resetCacheHitsAndMisses() = 0; #endif
/** * This non-global pool can be used for unit tests to verify that * the pool works.
*/ static sk_sp<SkDiscardableMemoryPool> Make(size_t size);
};
/** * Returns (and creates if needed) a threadsafe global * SkDiscardableMemoryPool.
*/
SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.