diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 1cde450dc25839c23c990c609b1d6cc7002fcdee..e2c4b63276442bca0eda3eea4266bd40729d9d37 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -336,7 +336,7 @@ class MemTrackable void* operator new(size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); @@ -348,7 +348,7 @@ class MemTrackable void operator delete(void* ptr, size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); @@ -360,7 +360,7 @@ class MemTrackable void *operator new [](size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); @@ -372,7 +372,7 @@ class MemTrackable void operator delete[](void* ptr, size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); @@ -438,15 +438,13 @@ class MemTrackable private: size_t mMemFootprint; - static MemStatHandle sMemStat; - template<typename TRACKED, typename TRACKED_IS_TRACKER = void> struct TrackMemImpl { static void claim(mem_trackable_t& tracker, const TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { size_t footprint = MemFootprint<TRACKED>::measure(tracked); @@ -457,7 +455,7 @@ class MemTrackable static void disclaim(mem_trackable_t& tracker, const TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { size_t footprint = MemFootprint<TRACKED>::measure(tracked); @@ -472,7 +470,7 @@ class MemTrackable { static void claim(mem_trackable_t& tracker, TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() + (F64)MemFootprint<TRACKED>::measure(tracked)); @@ -481,7 +479,7 @@ class MemTrackable static void disclaim(mem_trackable_t& tracker, TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() - (F64)MemFootprint<TRACKED>::measure(tracked)); @@ -490,9 +488,5 @@ class MemTrackable }; }; -template<typename DERIVED, size_t ALIGNMENT> -MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat(typeid(DERIVED).name()); - - } #endif // LL_LLTRACE_H diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 395e6a6cc503c928cb70c00e652306507f71c697..8477e62db750b01506697a62819df469d9279a2e 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -50,6 +50,7 @@ LLMutex* LLImage::sMutex = NULL; bool LLImage::sUseNewByteRange = false; S32 LLImage::sMinimalReverseByteRangePercent = 75; LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; +LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage"); //static void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index b2bfdba3f84c20b66f234976265ae324f4c70927..504b7e4795ca7b9477cbf822da5e58be66fd479f 100755 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -165,6 +165,8 @@ class LLImageBase static void destroyPrivatePool() ; static LLPrivateMemoryPool* getPrivatePool() {return sPrivatePoolp;} + static LLTrace::MemStatHandle sMemStat; + private: U8 *mData; S32 mDataSize; diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp index 7d7e9e036e2bfc199e8cd71528d202502132299d..aba788397498922ff980447586b17badd52cbecd 100755 --- a/indra/llimage/tests/llimageworker_test.cpp +++ b/indra/llimage/tests/llimageworker_test.cpp @@ -44,6 +44,9 @@ // * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code) // * A simulator for a class can be implemented here. Please comment and document thoroughly. +LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage"); + + LLImageBase::LLImageBase() : mData(NULL), mDataSize(0), diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index 0e73f33e0476d4345ed3f2ba0f645c6c81772a11..14fbf344abf6294f690a82a2b2673a6dd3680b37 100755 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -44,6 +44,8 @@ // End Stubbing // ------------------------------------------------------------------------------------------- // Stub the LL Image Classes +LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage"); + LLImageRaw::LLImageRaw() { } LLImageRaw::~LLImageRaw() { } U8* LLImageRaw::allocateData(S32 ) { return NULL; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 984594177807d20124fb28ea957644e479903bd9..7243931dbbd435cf30e543f7ed89de9f63ce333e 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,6 +48,8 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. +LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); + LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), mDocIndexEnd(index_end), diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 3e93b7de65bb0da493ee552dc999c6e8a5421ef9..74dc7f969313d40292a698c831c3f6af999cc7e3 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -100,6 +100,8 @@ class LLTextSegment S32 getEnd() const { return mEnd; } void setEnd( S32 end ) { mEnd = end; } + static LLTrace::MemStatHandle sMemStat; + protected: S32 mStart; S32 mEnd; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index b2805a32e854736c6c34e06123d752251b52b07a..daeb4d79399f5f2578ba5943974d6ca20f5c3548 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -69,6 +69,7 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; +LLTrace::MemStatHandle LLView::sMemStat("LLView"); std::vector<LLViewDrawContext*> LLViewDrawContext::sDrawContextStack; LLView::DrilldownFunc LLView::sDrilldown = diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 62bfb5456648817746e0d4df3a5729b1f834f53d..0568fa889a34aa8901ac22b4266edcd9d4ff2e2b 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -675,6 +675,7 @@ class LLView static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; + static LLTrace::MemStatHandle sMemStat; }; namespace LLInitParam diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index dff0dcb2fd6af6c87dbcf681eff94ebbb0f9951e..901260bec85aaf687b4f3ef7edd5f9c212c74d1a 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,6 +35,8 @@ // external library headers // other Linden headers +LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); + /// LLViewModel::LLViewModel() : mDirty(false) diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index a2ca20c739c49bcacc5d94875889ad1d2529bd78..2c016d2560669373ad832b0a9aad9f678f88732f 100755 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,6 +83,8 @@ class LLViewModel // void setDirty() { mDirty = true; } + static LLTrace::MemStatHandle sMemStat; + protected: LLSD mValue; bool mDirty; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 3dddf4b55454163d566520c96965ec07947e897c..628f7f7bfb14ab659dbcc1a5665f3472b484140b 100755 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -59,6 +59,7 @@ const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f; static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); extern bool gShiftFrame; +LLTrace::MemStatHandle LLDrawable::sMemStat("LLDrawable"); //////////////////////// diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 4558597d89b4b3ed3a298427be4c3face8de7123..b7c5aeb5a87b331e591caba870fbf3228b23e558 100755 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -293,6 +293,7 @@ class LLDrawable F32 mDistanceWRTCamera; static F32 sCurPixelAngle; //current pixels per radian + static LLTrace::MemStatHandle sMemStat; private: typedef std::vector<LLFace*> face_list_t; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index c633e3acdde9d04aa37426065de895936d9fb5be..4e514ddfd16891640fdcbde2307ccd311149bf66 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -114,6 +114,8 @@ BOOL LLViewerObject::sMapDebug = TRUE; LLColor4 LLViewerObject::sEditSelectColor( 1.0f, 1.f, 0.f, 0.3f); // Edit OK LLColor4 LLViewerObject::sNoEditSelectColor( 1.0f, 0.f, 0.f, 0.3f); // Can't edit S32 LLViewerObject::sAxisArrowLength(50); +LLTrace::MemStatHandle LLViewerObject::sMemStat("LLViewerObject"); + BOOL LLViewerObject::sPulseEnabled(FALSE); BOOL LLViewerObject::sUseSharedDrawables(FALSE); // TRUE diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 63da7152b38edec9046723a3716159347b6399e8..5556a4c7d3a1f63af73c89d7c9f108752dd718df 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -661,6 +661,7 @@ class LLViewerObject LLPointer<class LLHUDIcon> mIcon; static BOOL sUseSharedDrawables; + static LLTrace::MemStatHandle sMemStat; protected: // delete an item in the inventory, but don't tell the diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index d87eb5d3db915717d438e5bc0c288d4d6f3f37c1..60d78890b5f59f2807155ecd296d83e01d634582 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -34,6 +34,8 @@ #include "llviewerregion.h" #include "pipeline.h" +LLTrace::MemStatHandle LLVOCachePartition::sMemStat("LLVOCachePartition"); + BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) { return apr_file->read(src, n_bytes) == n_bytes ; diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index c43c42908f4e331e74ad85de41448d318aa0f852..c42374e154b2b5b1abcabef11e42fb0b12a1662c 100755 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -157,6 +157,8 @@ class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTr /*virtual*/ S32 cull(LLCamera &camera); void addOccluders(LLviewerOctreeGroup* gp); + static LLTrace::MemStatHandle sMemStat; + private: void processOccluders(LLCamera* camera, const LLVector3* region_agent);