summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturecache.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-08 09:30:39 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-08 09:30:39 -0700
commit470d1595cc1c1c7c7ec3ab192e68622751423354 (patch)
tree079cd01cc1b247973f2e5fd589389cc8e0013b13 /indra/newview/lltexturecache.cpp
parent06097302f4ad8786913e77514d5d60678da3160d (diff)
parent34322f8f37380df868703051230f2a4109602b3f (diff)
Merge viewer-release
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rw-r--r--indra/newview/lltexturecache.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 633e025478..e5af47ab6c 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -825,10 +825,10 @@ void LLTextureCacheWorker::endWork(S32 param, bool aborted)
LLTextureCache::LLTextureCache(bool threaded)
: LLWorkerThread("TextureCache", threaded),
- mWorkersMutex(NULL),
- mHeaderMutex(NULL),
- mListMutex(NULL),
- mFastCacheMutex(NULL),
+ mWorkersMutex(),
+ mHeaderMutex(),
+ mListMutex(),
+ mFastCacheMutex(),
mHeaderAPRFile(NULL),
mReadOnly(TRUE), //do not allow to change the texture cache until setReadOnly() is called.
mTexturesSizeTotal(0),
@@ -1038,11 +1038,11 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache
{
llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized.
- S64 header_size = (max_size / 100) * 36; //0.36 * max_size
- S64 max_entries = header_size / (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE);
+ S64 entries_size = (max_size * 36) / 100; //0.36 * max_size
+ S64 max_entries = entries_size / (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE);
sCacheMaxEntries = (S32)(llmin((S64)sCacheMaxEntries, max_entries));
- header_size = sCacheMaxEntries * TEXTURE_CACHE_ENTRY_SIZE;
- max_size -= header_size;
+ entries_size = sCacheMaxEntries * (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE);
+ max_size -= entries_size;
if (sCacheMaxTexturesSize > 0)
sCacheMaxTexturesSize = llmin(sCacheMaxTexturesSize, max_size);
else