summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2010-12-22 14:23:35 -0800
committerDon Kjer <don@lindenlab.com>2010-12-22 14:23:35 -0800
commit649dd6eb74023d48379ebaadd2ff000801306f17 (patch)
tree83a42667d25294f8b54378324a08f7ffb2105731 /indra
parent14e402cf5e8274caddaf1c763c2e044c53514b1e (diff)
Cleanup from review with Andrew and Merov
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerobject.cpp4
-rw-r--r--indra/newview/llviewerobject.h4
-rw-r--r--indra/newview/llviewerobjectlist.cpp12
-rw-r--r--indra/newview/llviewerregion.cpp42
-rw-r--r--indra/newview/llvocache.cpp2
5 files changed, 30 insertions, 34 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 3c12cb66b2..4b7e518af3 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -5402,7 +5402,7 @@ void LLViewerObject::setAttachmentItemID(const LLUUID &id)
mAttachmentItemID = id;
}
-EObjectUpdateType LLViewerObject::getLastUpdateType()
+EObjectUpdateType LLViewerObject::getLastUpdateType() const
{
return mLastUpdateType;
}
@@ -5412,7 +5412,7 @@ void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type)
mLastUpdateType = last_update_type;
}
-BOOL LLViewerObject::getLastUpdateCached()
+BOOL LLViewerObject::getLastUpdateCached() const
{
return mLastUpdateCached;
}
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index c83cc06128..78837ec0a1 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -697,9 +697,9 @@ public:
const LLUUID &getAttachmentItemID() const;
void setAttachmentItemID(const LLUUID &id);
const LLUUID &extractAttachmentItemID(); // find&set the inventory item ID of the attached object
- EObjectUpdateType getLastUpdateType();
+ EObjectUpdateType getLastUpdateType() const;
void setLastUpdateType(EObjectUpdateType last_update_type);
- BOOL getLastUpdateCached();
+ BOOL getLastUpdateCached() const;
void setLastUpdateCached(BOOL last_update_cached);
private:
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 77fbc08ca4..5849ab4307 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -306,7 +306,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
// I don't think this case is ever hit. TODO* Test this.
if (!cached && !compressed && update_type != OUT_FULL)
{
- llinfos << "TEST: !cached && !compressed && update_type != OUT_FULL" << llendl;
+ //llinfos << "TEST: !cached && !compressed && update_type != OUT_FULL" << llendl;
gTerseObjectUpdates += num_objects;
S32 size;
if (mesgsys->getReceiveCompressedSize())
@@ -317,7 +317,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
size = mesgsys->getReceiveSize();
}
- llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
+ //llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
}
else
{
@@ -403,7 +403,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
// I don't think we ever use this flag from the server. DK 2010/12/09
if (flags & FLAGS_ZLIB_COMPRESSED)
{
- llinfos << "TEST: flags & FLAGS_ZLIB_COMPRESSED" << llendl;
+ //llinfos << "TEST: flags & FLAGS_ZLIB_COMPRESSED" << llendl;
compressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compbuffer, 0, i);
uncompressed_length = 2048;
@@ -500,7 +500,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type == OUT_TERSE_IMPROVED)
{
- llinfos << "terse update for an unknown object (compressed):" << fullid << llendl;
+ // llinfos << "terse update for an unknown object (compressed):" << fullid << llendl;
#if LL_RECORD_VIEWER_STATS
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
#endif
@@ -514,7 +514,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type != OUT_FULL)
{
- llinfos << "terse update for an unknown object:" << fullid << llendl;
+ //llinfos << "terse update for an unknown object:" << fullid << llendl;
#if LL_RECORD_VIEWER_STATS
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
#endif
@@ -527,7 +527,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (mDeadObjects.find(fullid) != mDeadObjects.end())
{
mNumDeadObjectUpdates++;
- llinfos << "update for a dead object:" << fullid << llendl;
+ //llinfos << "update for a dead object:" << fullid << llendl;
#if LL_RECORD_VIEWER_STATS
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
#endif
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index ea6f1ab342..4648f318d4 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1049,33 +1049,29 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec
entry->recordDupe();
return CACHE_UPDATE_DUPE;
}
- else
- {
- // Update the cache entry
- mCacheMap.erase(local_id);
- delete entry;
- entry = new LLVOCacheEntry(local_id, crc, dp);
- mCacheMap[local_id] = entry;
- return CACHE_UPDATE_CHANGED;
- }
- }
- else
- {
- // we haven't seen this object before
- // Create new entry and add to map
- eCacheUpdateResult result = CACHE_UPDATE_ADDED;
- if (mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES)
- {
- mCacheMap.erase(mCacheMap.begin());
- result = CACHE_UPDATE_REPLACED;
-
- }
+ // Update the cache entry
+ mCacheMap.erase(local_id);
+ delete entry;
entry = new LLVOCacheEntry(local_id, crc, dp);
-
mCacheMap[local_id] = entry;
- return result;
+ return CACHE_UPDATE_CHANGED;
+ }
+
+ // we haven't seen this object before
+
+ // Create new entry and add to map
+ eCacheUpdateResult result = CACHE_UPDATE_ADDED;
+ if (mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES)
+ {
+ mCacheMap.erase(mCacheMap.begin());
+ result = CACHE_UPDATE_REPLACED;
+
}
+ entry = new LLVOCacheEntry(local_id, crc, dp);
+
+ mCacheMap[local_id] = entry;
+ return result;
}
// Get data packer for this object, if we have cached data
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 040139f3ab..d372fd0212 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -593,7 +593,7 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
void LLVOCache::purgeEntries()
{
- U32 limit = mCacheSize / ENTRIES_PURGE_FACTOR;
+ U32 limit = mCacheSize - (mCacheSize / ENTRIES_PURGE_FACTOR);
limit = llclamp(limit, (U32)1, mCacheSize);
// Construct a vector of entries out of the map so we can sort by time.
std::vector<HeaderEntryInfo*> header_vector;