memory: implemented basic memory limiting functionality

Keeps track of total memory usage and uses it as a guide towards
allocating/reusing more memory.
This commit is contained in:
itsmattkc
2020-08-29 13:34:54 +10:00
parent c99eb68d45
commit 050103a857
5 changed files with 63 additions and 11 deletions
+14
View File
@@ -0,0 +1,14 @@
#include "memorypool.h"
OLIVE_NAMESPACE_ENTER
size_t memory_pool_consumption = 0;
QMutex memory_pool_consumption_lock;
bool MemoryPoolLimitReached()
{
QMutexLocker locker(&memory_pool_consumption_lock);
return (memory_pool_consumption >= 2147483648);
}
OLIVE_NAMESPACE_EXIT