mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Added constant
This commit is contained in:
parent
77e4a2ef35
commit
ea832cfd45
1 changed files with 2 additions and 1 deletions
|
@ -73,8 +73,9 @@ QSharedPointer<Resource> ResourceCache::getResource(const QUrl& url, const QUrl&
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceCache::addUnusedResource(const QSharedPointer<Resource>& resource) {
|
void ResourceCache::addUnusedResource(const QSharedPointer<Resource>& resource) {
|
||||||
|
static constexpr int BYTES_PER_MEGABYTES = 1024 * 1024;
|
||||||
const int RETAINED_RESOURCE_COUNT = 50;
|
const int RETAINED_RESOURCE_COUNT = 50;
|
||||||
const int RETAINED_RESOURCE_SIZE = 100 * 1024 * 1024;
|
const int RETAINED_RESOURCE_SIZE = 100 * BYTES_PER_MEGABYTES;
|
||||||
|
|
||||||
while (_unusedResourcesTotalBytes + resource->getBytesTotal() > RETAINED_RESOURCE_SIZE &&
|
while (_unusedResourcesTotalBytes + resource->getBytesTotal() > RETAINED_RESOURCE_SIZE &&
|
||||||
!_unusedResources.empty()) {
|
!_unusedResources.empty()) {
|
||||||
|
|
Loading…
Reference in a new issue