mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 21:53:12 +02:00
Add sanity check to ResourceCache::updateTotalSize
This commit is contained in:
parent
cba5bff89e
commit
2fd88d9fe1
2 changed files with 6 additions and 1 deletions
|
@ -424,6 +424,11 @@ void ResourceCache::removeResource(const QUrl& url, qint64 size) {
|
|||
|
||||
void ResourceCache::updateTotalSize(const qint64& deltaSize) {
|
||||
_totalResourcesSize += deltaSize;
|
||||
|
||||
// Sanity checks
|
||||
assert(_totalResourcesSize >= 0);
|
||||
assert(_totalResourcesSize < (1024 * BYTES_PER_GIGABYTES));
|
||||
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ static const qint64 DEFAULT_UNUSED_MAX_SIZE = 100 * BYTES_PER_MEGABYTES;
|
|||
static const qint64 DEFAULT_UNUSED_MAX_SIZE = 1024 * BYTES_PER_MEGABYTES;
|
||||
#endif
|
||||
static const qint64 MIN_UNUSED_MAX_SIZE = 0;
|
||||
static const qint64 MAX_UNUSED_MAX_SIZE = 10 * BYTES_PER_GIGABYTES;
|
||||
static const qint64 MAX_UNUSED_MAX_SIZE = MAXIMUM_CACHE_SIZE;
|
||||
|
||||
// We need to make sure that these items are available for all instances of
|
||||
// ResourceCache derived classes. Since we can't count on the ordering of
|
||||
|
|
Loading…
Reference in a new issue