summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerregion.cpp13
-rw-r--r--indra/newview/llviewerregion.h1
-rw-r--r--indra/newview/llvocache.cpp4
-rw-r--r--indra/newview/llvocache.h2
4 files changed, 13 insertions, 7 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d8f9ecf248..64cf33a9eb 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -442,6 +442,10 @@ void LLViewerRegion::loadObjectCache()
if(LLVOCache::hasInstance())
{
LLVOCache::getInstance()->readFromCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap) ;
+ if (mImpl->mCacheMap.empty())
+ {
+ mCacheDirty = TRUE;
+ }
}
}
@@ -460,11 +464,10 @@ void LLViewerRegion::saveObjectCache()
if(LLVOCache::hasInstance())
{
- //NOTE: !!!!!!!!!!
- //set this to be true when support full region cache probe!!!!
- BOOL full_region_cache_probe = FALSE;
+ const F32 start_time_threshold = 600.0f; //seconds
+ bool removal_enabled = mRegionTimer.getElapsedTimeF32() > start_time_threshold; //allow to remove invalid objects from object cache file.
- LLVOCache::getInstance()->writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, full_region_cache_probe) ;
+ LLVOCache::getInstance()->writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, removal_enabled) ;
mCacheDirty = FALSE;
}
@@ -2176,6 +2179,8 @@ void LLViewerRegion::unpackRegionHandshake()
}
msg->addU32("Flags", flags );
msg->sendReliable(host);
+
+ mRegionTimer.reset(); //reset region timer.
}
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 22936fb103..2248cf5269 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -399,6 +399,7 @@ public:
static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not.
private:
LLViewerRegionImpl * mImpl;
+ LLFrameTimer mRegionTimer;
F32 mWidth; // Width of region on a side (meters)
U64 mHandle;
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index a08e01784c..caa87eb1eb 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -906,7 +906,7 @@ void LLVOCache::purgeEntries(U32 size)
mNumEntries = mHandleEntryMap.size() ;
}
-void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, BOOL full_region_cache_probe)
+void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled)
{
if(!mEnabled)
{
@@ -979,7 +979,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
for (LLVOCacheEntry::vocache_entry_map_t::const_iterator iter = cache_entry_map.begin(); success && iter != cache_entry_map.end(); ++iter)
{
- if(!full_region_cache_probe || iter->second->isTouched())
+ if(!removal_enabled || iter->second->isTouched())
{
success = iter->second->writeToFile(&apr_file) ;
}
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index c26bebb451..5f2dd63051 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -202,7 +202,7 @@ public:
void removeCache(ELLPath location, bool started = false) ;
void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ;
- void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, BOOL full_region_cache_probe);
+ void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled);
void removeEntry(U64 handle) ;
void setReadOnly(BOOL read_only) {mReadOnly = read_only;}