mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
35 lines
716 B
C++
35 lines
716 B
C++
extern StaticMutex ValueCacheMutex;
|
|
|
|
LRUCache<Value>& TheValueCache();
|
|
|
|
typedef LRUCache<Value>::Maker ValueMaker;
|
|
|
|
Value MakeValue(ValueMaker& m);
|
|
|
|
bool IsValueCacheActive();
|
|
|
|
void AdjustValueCache();
|
|
void ShrinkValueCache();
|
|
|
|
void SetupValueCache(int limit_low, int limit_high, double ratio);
|
|
|
|
template <class P>
|
|
int ValueCacheRemove(P what)
|
|
{
|
|
Mutex::Lock __(ValueCacheMutex);
|
|
return TheValueCache().Remove(what);
|
|
}
|
|
|
|
template <class P>
|
|
int ValueCacheRemoveOne(P what)
|
|
{
|
|
Mutex::Lock __(ValueCacheMutex);
|
|
return TheValueCache().Remove(what);
|
|
}
|
|
|
|
template <class P>
|
|
void ValueCacheAdjustSize(P getsize)
|
|
{
|
|
Mutex::Lock __(ValueCacheMutex);
|
|
TheValueCache().AdjustSize(getsize);
|
|
}
|