41 bool reserveSpace(
exint nbytes);
73 void clearStats() { myStatsNumReductions = 0; myStatsFlushedBytes = 0; }
82 return myCurrentUsage;
98 return myMaximumUsage;
105 static void setMemoryUsageRatio(
fpreal ratio);
119 void internalSetMemoryUsageRatio(
fpreal ratio);
129 const char *
name()
const override
131 return myMemoryPool.utGetCacheName();
135 RequestSeverity
severity, Niceness niceness,
138 freed_amount = myMemoryPool.utReduceCacheSizeBy(amount);
139 return freed_amount > 0;
143 exint &cache)
override
145 in_use = myMemoryPool.utGetCurrentSize();
155 class ImageUsersRecord;
162 std::list<ImageUsersRecord*> myLRUList;
164 exint myCurrentUsage = 0;
166 exint myMaximumUsage = 0;
168 exint myStatsNumReductions = 0;
170 exint myStatsFlushedBytes = 0;
175 MemoryClient myMemoryClient;
virtual const char * utGetCacheName() const =0
required - return the english name for this cache.
bool utHasMaxSize() const override
Required override to indicate that this cache has a maximum size.
exint bytesFlushed() const
exint numReductionRequests() const
virtual int64 utReduceCacheSizeBy(int64 amount)=0
int64 utGetCurrentSize() const override
Returns the amount of GPU memory currently in use by CE buffers.
GLuint const GLchar * name
Common base class for various caches.
int64 utGetMaxSize() const override
Returns the maximum amount of GPU memory CE buffers are allowed to use.
virtual void utSetMaxSize(int64)
CE_API CE_HotSwapPool & CEgetHotSwapPool()
Returns the global memory pool for CE GPU storage.
Wrapper for a client of a limit memory resource.
**Note that the tasks the is the thread number *for the pool