diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index 4939a44ce..d284952d6 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -162,7 +162,6 @@ void LLMemory::logMemoryInfo(BOOL update) if(update) { updateMemoryInfo() ; - LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ; } llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ; diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index c55c66dd8..017d48a0e 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -90,8 +90,8 @@ public: typedef LLOctreeTraveler oct_traveler; typedef LLTreeTraveler tree_traveler; typedef typename std::set > element_list; - typedef typename std::set >::iterator element_iter; - typedef typename std::set >::const_iterator const_element_iter; + typedef typename element_list::iterator element_iter; + typedef typename element_list::const_iterator const_element_iter; typedef typename std::vector*>::iterator tree_listener_iter; typedef typename std::vector* > child_list; typedef LLTreeNode BaseType; @@ -124,6 +124,8 @@ public: mOctant = ((oct_node*) mParent)->getOctant(mCenter); } + mElementCount = 0; + clearChildren(); } @@ -229,11 +231,11 @@ public: void accept(oct_traveler* visitor) { visitor->visit(this); } virtual bool isLeaf() const { return mChild.empty(); } - U32 getElementCount() const { return mData.size(); } + U32 getElementCount() const { return mElementCount; } element_list& getData() { return mData; } const element_list& getData() const { return mData; } - U32 getChildCount() const { return mChild.size(); } + U32 getChildCount() const { return mChildCount; } oct_node* getChild(U32 index) { return mChild[index]; } const oct_node* getChild(U32 index) const { return mChild[index]; } child_list& getChildren() { return mChild; } @@ -321,6 +323,8 @@ public: mData.insert(data); BaseType::insert(data); + + mElementCount = mData.size(); return true; } else @@ -356,6 +360,8 @@ public: { mData.insert(data); BaseType::insert(data); + + mElementCount = mData.size(); return true; } @@ -409,6 +415,7 @@ public: if (mData.find(data) != mData.end()) { //we have data mData.erase(data); + mElementCount = mData.size(); notifyRemoval(data); checkAlive(); return true; @@ -446,6 +453,7 @@ public: if (mData.find(data) != mData.end()) { mData.erase(data); + mElementCount = mData.size(); notifyRemoval(data); llwarns << "FOUND!" << llendl; checkAlive(); @@ -462,7 +470,7 @@ public: void clearChildren() { mChild.clear(); - + mChildCount = 0; U32* foo = (U32*) mChildMap; foo[0] = foo[1] = 0xFFFFFFFF; } @@ -522,9 +530,10 @@ public: } #endif - mChildMap[child->getOctant()] = (U8) mChild.size(); + mChildMap[child->getOctant()] = mChildCount; mChild.push_back(child); + ++mChildCount; child->setParent(this); if (!silent) @@ -553,12 +562,13 @@ public: delete mChild[index]; } mChild.erase(mChild.begin() + index); + --mChildCount; //rebuild child map U32* foo = (U32*) mChildMap; foo[0] = foo[1] = 0xFFFFFFFF; - for (U32 i = 0; i < mChild.size(); ++i) + for (U32 i = 0; i < mChildCount; ++i) { mChildMap[mChild[i]->getOctant()] = i; } @@ -611,8 +621,10 @@ protected: child_list mChild; U8 mChildMap[8]; + U32 mChildCount; element_list mData; + U32 mElementCount; };