summaryrefslogtreecommitdiff
path: root/indra/newview/llvocache.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2010-11-11 09:29:30 -0500
committerOz Linden <oz@lindenlab.com>2010-11-11 09:29:30 -0500
commit20921d6a1a2e98fee750cb5a76adddb7266183f3 (patch)
tree8966865c6484af39f1d2af276f961f0999e49a3f /indra/newview/llvocache.cpp
parentb5df1d2abcef04ee5f491a7414189f4e82faaa1e (diff)
parentfc22e2cf5bfc97caaf1ad69814b7dd217cbafef0 (diff)
merge performance data tracking system STORM-104
Diffstat (limited to 'indra/newview/llvocache.cpp')
-rw-r--r--indra/newview/llvocache.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 1cb3962daa..145ee31260 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -224,7 +224,6 @@ BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const
// Format string used to construct filename for the object cache
static const char OBJECT_CACHE_FILENAME[] = "objects_%d_%d.slc";
-const U32 MAX_NUM_OBJECT_ENTRIES = 128 ;
const U32 NUM_ENTRIES_TO_PURGE = 16 ;
const char* object_cache_dirname = "objectcache";
const char* header_filename = "object.cache";
@@ -296,9 +295,9 @@ void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version)
if (!mReadOnly)
{
LLFile::mkdir(mObjectCacheDirName);
- }
- mCacheSize = llclamp(size,
- MAX_NUM_OBJECT_ENTRIES, NUM_ENTRIES_TO_PURGE);
+ }
+
+ mCacheSize = size;
mMetaInfo.mVersion = cache_version;
readCacheHeader();
@@ -434,7 +433,7 @@ void LLVOCache::readCacheHeader()
HeaderEntryInfo* entry ;
mNumEntries = 0 ;
- while(mNumEntries < MAX_NUM_OBJECT_ENTRIES)
+ while(mNumEntries < mCacheSize)
{
entry = new HeaderEntryInfo() ;
if(!checkRead(apr_file, entry, sizeof(HeaderEntryInfo)))
@@ -487,10 +486,10 @@ void LLVOCache::writeCacheHeader()
}
mNumEntries = mHeaderEntryQueue.size() ;
- if(mNumEntries < MAX_NUM_OBJECT_ENTRIES)
+ if(mNumEntries < mCacheSize)
{
HeaderEntryInfo* entry = new HeaderEntryInfo() ;
- for(S32 i = mNumEntries ; i < MAX_NUM_OBJECT_ENTRIES ; i++)
+ for(U32 i = mNumEntries ; i < mCacheSize; i++)
{
//fill the cache with the default entry.
if(!checkWrite(apr_file, entry, sizeof(HeaderEntryInfo)))