From 1f56e57008f5a50c9e75fc0b4512c483ac359a52 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Dec 2012 00:58:26 -0800 Subject: SH-3468 WIP add memory tracking base class created memory tracking trace type instrumented a few classes with memory tracking --- indra/llimage/llimage.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 914bf836c1..22dd809ef3 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -157,7 +157,8 @@ void LLImageBase::sanityCheck() // virtual void LLImageBase::deleteData() { - FREE_MEM(sPrivatePoolp, mData) ; + FREE_MEM(sPrivatePoolp, mData); + memDisclaim(mDataSize); mData = NULL; mDataSize = 0; } @@ -201,6 +202,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; + memClaim(mDataSize); } return mData; @@ -222,7 +224,9 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; + memDisclaim(mDataSize); mDataSize = size; + memClaim(mDataSize); return mData; } @@ -1584,7 +1588,9 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8* void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); + memDisclaim(mDataSize); mData = data; mDataSize = size; + memClaim(mDataSize); } //static -- cgit v1.2.3 From cbff0e7ab8afeebb6ddab854d35ea12ef9a9930a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 4 Jan 2013 13:48:35 -0800 Subject: SH-3468 WIP add memory tracking base class attempted fix for gcc compile errors can't use typeid() on a class that doesn't have a method defined in a translation unit fix is to force classes deriving from LLMemTrackable to use their own static member named sMemStat --- indra/llimage/llimage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 22dd809ef3..56f6b0964c 100644 --- 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::MemStat LLImage::sMemStat("LLImage"); //static void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) -- cgit v1.2.3 From 4ebd4b3616d9d69e9b6deb73aa1f1e16f5673225 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 4 Jan 2013 14:09:02 -0800 Subject: SH-3468 WIP add memory tracking base class further compile error fixes --- indra/llimage/llimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 56f6b0964c..f3452ce86a 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -50,7 +50,7 @@ LLMutex* LLImage::sMutex = NULL; bool LLImage::sUseNewByteRange = false; S32 LLImage::sMinimalReverseByteRangePercent = 75; LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; -LLTrace::MemStat LLImage::sMemStat("LLImage"); +LLTrace::MemStat LLImageBase::sMemStat("LLImage"); //static void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) -- cgit v1.2.3 From f07b9c2c69f1f6882dcf249aacf33cdfacf878ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Mar 2013 11:08:25 -0800 Subject: renamed LLTrace stat gathering classes/methods to make the structure of LLTrace clearer Count becomes CountStatHandle Count.sum becomes sum(Count, value), etc. --- indra/llimage/llimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index f3452ce86a..f06547ed7d 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -50,7 +50,7 @@ LLMutex* LLImage::sMutex = NULL; bool LLImage::sUseNewByteRange = false; S32 LLImage::sMinimalReverseByteRangePercent = 75; LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; -LLTrace::MemStat LLImageBase::sMemStat("LLImage"); +LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage"); //static void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) -- cgit v1.2.3 From a74b5dfa923f8eeccc9b786143f0f832de3ad450 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 4 Jun 2013 19:45:33 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed mem stat tracking...now properly tracks memory footprint with floating point precision cleaned up macros for unit declaration renamed units to SI standard for 1024 multiples (kibibytes, etc) fixed units output for scene monitor dump --- indra/llimage/llimage.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index e7e274ff03..80634b3887 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -159,7 +159,7 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - memDisclaim(mDataSize); + memDisclaimAmount(mDataSize); mData = NULL; mDataSize = 0; } @@ -203,7 +203,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; - memClaim(mDataSize); + memClaimAmount(mDataSize); } return mData; @@ -225,9 +225,9 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - memDisclaim(mDataSize); + memDisclaimAmount(mDataSize); mDataSize = size; - memClaim(mDataSize); + memClaimAmount(mDataSize); return mData; } @@ -1589,9 +1589,9 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8* void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); - memDisclaim(mDataSize); + memDisclaimAmount(mDataSize); mData = data; mDataSize = size; - memClaim(mDataSize); + memClaimAmount(mDataSize); } //static -- cgit v1.2.3 From 04bdc8ba83c297945dd60489c241b88adf892ff4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 17:04:01 -0700 Subject: SH-4294 FIX Interesting: Statistics Texture cache hit rate is always 0% also, removed LLTrace::init and cleanup removed derived class implementation of memory stat for LLMemTrackable is automatic now --- indra/llimage/llimage.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 50df2ebe55..395e6a6cc5 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -50,7 +50,6 @@ 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) @@ -159,9 +158,8 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - memDisclaimAmount(mDataSize); + memDisclaimAmount(mDataSize) = 0; mData = NULL; - mDataSize = 0; } // virtual @@ -225,9 +223,7 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - memDisclaimAmount(mDataSize); - mDataSize = size; - memClaimAmount(mDataSize); + memClaimAmount(memDisclaimAmount(mDataSize) = size); return mData; } @@ -1612,9 +1608,8 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8* void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); - memDisclaimAmount(mDataSize); - mData = data; mDataSize = size; - memClaimAmount(mDataSize); + mData = data; + memClaimAmount(memDisclaimAmount(mDataSize) = size); } //static -- cgit v1.2.3 From 8208a40412fac35593d4b8b13f43c6be5e4d6990 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 18:50:51 -0700 Subject: BUILDFIX: reverted changes that attempted to automate mem track stat definition as they don't work on gcc/clang --- indra/llimage/llimage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 395e6a6cc5..8477e62db7 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) -- cgit v1.2.3 From 075a7bcc980b0ca0d2888d344b6afa8ab5b52d85 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 18 Jul 2013 15:09:45 -0700 Subject: SH-4297 WIP interesting: viewer-interesting starts loading cached scene late dependency cleanup - removed a lot of unecessary includes --- indra/llimage/llimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 8477e62db7..655d7a381a 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" +#include "llimageworker.h" #include "llimage.h" #include "llmath.h" @@ -37,7 +38,6 @@ #include "llimagejpeg.h" #include "llimagepng.h" #include "llimagedxt.h" -#include "llimageworker.h" #include "llmemory.h" //--------------------------------------------------------------------------- -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/llimage/llimage.cpp | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 655d7a381a..83638b56a3 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -128,12 +128,12 @@ void LLImageBase::destroyPrivatePool() // virtual void LLImageBase::dump() { - llinfos << "LLImageBase mComponents " << mComponents + LL_INFOS() << "LLImageBase mComponents " << mComponents << " mData " << mData << " mDataSize " << mDataSize << " mWidth " << mWidth << " mHeight " << mHeight - << llendl; + << LL_ENDL; } // virtual @@ -145,13 +145,13 @@ void LLImageBase::sanityCheck() || mComponents > (S8)MAX_IMAGE_COMPONENTS ) { - llerrs << "Failed LLImageBase::sanityCheck " + LL_ERRS() << "Failed LLImageBase::sanityCheck " << "width " << mWidth << "height " << mHeight << "datasize " << mDataSize << "components " << mComponents << "data " << mData - << llendl; + << LL_ENDL; } } @@ -171,7 +171,7 @@ U8* LLImageBase::allocateData(S32 size) size = mWidth * mHeight * mComponents; if (size <= 0) { - llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl; + LL_ERRS() << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL; } } @@ -179,14 +179,14 @@ U8* LLImageBase::allocateData(S32 size) static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16 ; //256 MB if (size < 1 || size > MAX_BUFFER_SIZE) { - llinfos << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << llendl ; + LL_INFOS() << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << LL_ENDL ; if(mAllowOverSize) { - llinfos << "Oversize: " << size << llendl ; + LL_INFOS() << "Oversize: " << size << LL_ENDL ; } else { - llerrs << "LLImageBase::allocateData: bad size: " << size << llendl; + LL_ERRS() << "LLImageBase::allocateData: bad size: " << size << LL_ENDL; } } if (!mData || size != mDataSize) @@ -196,7 +196,7 @@ U8* LLImageBase::allocateData(S32 size) mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); if (!mData) { - llwarns << "Failed to allocate image data size [" << size << "]" << llendl; + LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL; size = 0 ; mWidth = mHeight = 0 ; mBadBufferAllocation = true ; @@ -214,7 +214,7 @@ U8* LLImageBase::reallocateData(S32 size) U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); if (!new_datap) { - llwarns << "Out of memory in LLImageBase::reallocateData" << llendl; + LL_WARNS() << "Out of memory in LLImageBase::reallocateData" << LL_ENDL; return 0; } if (mData) @@ -232,7 +232,7 @@ const U8* LLImageBase::getData() const { if(mBadBufferAllocation) { - llerrs << "Bad memory allocation for the image buffer!" << llendl ; + LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ; } return mData; @@ -242,7 +242,7 @@ U8* LLImageBase::getData() { if(mBadBufferAllocation) { - llerrs << "Bad memory allocation for the image buffer!" << llendl ; + LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ; } return mData; @@ -564,7 +564,7 @@ void LLImageRaw::composite( LLImageRaw* src ) // Src and dst can be any size. Src has 4 components. Dst has 3 components. void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) { - llinfos << "compositeScaled4onto3" << llendl; + LL_INFOS() << "compositeScaled4onto3" << LL_ENDL; LLImageRaw* dst = this; // Just for clarity. @@ -698,7 +698,7 @@ void LLImageRaw::copy(LLImageRaw* src) { if (!src) { - llwarns << "LLImageRaw::copy called with a null src pointer" << llendl; + LL_WARNS() << "LLImageRaw::copy called with a null src pointer" << LL_ENDL; return; } @@ -1215,8 +1215,8 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip llifstream ifs(name, llifstream::binary); if (!ifs.is_open()) { - // SJB: changed from llinfos to lldebugs to reduce spam - lldebugs << "Unable to open image file: " << name << llendl; + // SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam + LL_DEBUGS() << "Unable to open image file: " << name << LL_ENDL; return false; } @@ -1230,7 +1230,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip if (!length) { - llinfos << "Zero length file file: " << name << llendl; + LL_INFOS() << "Zero length file file: " << name << LL_ENDL; return false; } @@ -1266,7 +1266,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip if (!success) { deleteData(); - llwarns << "Unable to decode image" << name << llendl; + LL_WARNS() << "Unable to decode image" << name << LL_ENDL; return false; } @@ -1371,11 +1371,11 @@ void LLImageFormatted::dump() { LLImageBase::dump(); - llinfos << "LLImageFormatted" + LL_INFOS() << "LLImageFormatted" << " mDecoding " << mDecoding << " mCodec " << S32(mCodec) << " mDecoded " << mDecoded - << llendl; + << LL_ENDL; } //---------------------------------------------------------------------------- @@ -1458,11 +1458,11 @@ void LLImageFormatted::sanityCheck() if (mCodec >= IMG_CODEC_EOF) { - llerrs << "Failed LLImageFormatted::sanityCheck " + LL_ERRS() << "Failed LLImageFormatted::sanityCheck " << "decoding " << S32(mDecoding) << "decoded " << S32(mDecoded) << "codec " << S32(mCodec) - << llendl; + << LL_ENDL; } } @@ -1638,7 +1638,7 @@ void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 heig *(U8*)data = (U8)(((U32)(indata[0]) + indata[1] + indata[in_width] + indata[in_width+1])>>2); break; default: - llerrs << "generateMmip called with bad num channels" << llendl; + LL_ERRS() << "generateMmip called with bad num channels" << LL_ENDL; } indata += nchannels*2; data += nchannels; @@ -1695,17 +1695,17 @@ F32 LLImageBase::calc_download_priority(F32 virtual_size, F32 visible_pixels, S3 bytes_weight *= bytes_weight; - //llinfos << "VS: " << virtual_size << llendl; + //LL_INFOS() << "VS: " << virtual_size << LL_ENDL; F32 virtual_size_factor = virtual_size / (10.f*10.f); // The goal is for weighted priority to be <= 0 when we've reached a point where // we've sent enough data. - //llinfos << "BytesSent: " << bytes_sent << llendl; - //llinfos << "BytesWeight: " << bytes_weight << llendl; - //llinfos << "PreLog: " << bytes_weight * virtual_size_factor << llendl; + //LL_INFOS() << "BytesSent: " << bytes_sent << LL_ENDL; + //LL_INFOS() << "BytesWeight: " << bytes_weight << LL_ENDL; + //LL_INFOS() << "PreLog: " << bytes_weight * virtual_size_factor << LL_ENDL; w_priority = (F32)log10(bytes_weight * virtual_size_factor); - //llinfos << "PreScale: " << w_priority << llendl; + //LL_INFOS() << "PreScale: " << w_priority << LL_ENDL; // We don't want to affect how MANY bytes we send based on the visible pixels, but the order // in which they're sent. We post-multiply so we don't change the zero point. -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/llimage/llimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7a46f47473..bb4253a9f5 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -50,7 +50,7 @@ LLMutex* LLImage::sMutex = NULL; bool LLImage::sUseNewByteRange = false; S32 LLImage::sMinimalReverseByteRangePercent = 75; LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; -LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage"); +//LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage"); //static void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) -- cgit v1.2.3 From 0dfc08d22a21728ec670bd75e6fd0ed60c97bf06 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Sep 2013 15:21:46 -0700 Subject: BUILDFIX: more bad merge stuff also added ability for statbar to show memtrackable info --- indra/llimage/llimage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index bb4253a9f5..34e0e202b6 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -159,7 +159,7 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - memDisclaimAmount(mDataSize) = 0; + memDisclaim(mDataSize) = 0; mData = NULL; } @@ -202,7 +202,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; - memClaimAmount(mDataSize); + memClaim(mDataSize); } return mData; @@ -224,7 +224,7 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - memClaimAmount(memDisclaimAmount(mDataSize) = size); + memClaim(memDisclaim(mDataSize) = size); return mData; } @@ -1619,7 +1619,7 @@ void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); mData = data; - memClaimAmount(memDisclaimAmount(mDataSize) = size); + memClaim(memDisclaim(mDataSize) = size); } //static -- cgit v1.2.3 From 053d97db1b283ca2548dc1f64756ddfc5166158f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 25 Sep 2013 19:12:35 -0700 Subject: better memory usage for LLTrace (tighter packing of recording arrays) removed complicated and unnecessary fast timer gapless handoff logic (it should be gapless anyway) improved MemTrackable API, better separation of shadow and footprint added memory usage stats to floater_stats.xml --- indra/llimage/llimage.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 34e0e202b6..326f477504 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -50,7 +50,6 @@ 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) @@ -159,7 +158,7 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - memDisclaim(mDataSize) = 0; + disclaimMem(mDataSize) = 0; mData = NULL; } @@ -202,7 +201,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; - memClaim(mDataSize); + claimMem(mDataSize); } return mData; @@ -224,7 +223,7 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - memClaim(memDisclaim(mDataSize) = size); + claimMem(disclaimMem(mDataSize) = size); return mData; } @@ -1619,7 +1618,7 @@ void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); mData = data; - memClaim(memDisclaim(mDataSize) = size); + claimMem(disclaimMem(mDataSize) = size); } //static -- cgit v1.2.3 From 12f0f8cb72f789e21b01b45063dcc5f1f5292087 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 1 Oct 2013 13:46:43 -0700 Subject: changed over to manual naming of MemTrackable stats changed claimMem and disclaimMem behavior to not pass through argument added more mem tracking stats to floater_stats --- indra/llimage/llimage.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'indra/llimage/llimage.cpp') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 326f477504..1ca1bf55a6 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -89,15 +89,15 @@ void LLImage::setLastError(const std::string& message) //--------------------------------------------------------------------------- LLImageBase::LLImageBase() - : mData(NULL), - mDataSize(0), - mWidth(0), - mHeight(0), - mComponents(0), - mBadBufferAllocation(false), - mAllowOverSize(false) -{ -} +: LLTrace::MemTrackable("LLImage"), + mData(NULL), + mDataSize(0), + mWidth(0), + mHeight(0), + mComponents(0), + mBadBufferAllocation(false), + mAllowOverSize(false) +{} // virtual LLImageBase::~LLImageBase() @@ -158,7 +158,8 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - disclaimMem(mDataSize) = 0; + disclaimMem(mDataSize); + mDataSize = 0; mData = NULL; } @@ -223,7 +224,9 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - claimMem(disclaimMem(mDataSize) = size); + disclaimMem(mDataSize); + mDataSize = size; + claimMem(mDataSize); return mData; } @@ -1618,7 +1621,9 @@ void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); mData = data; - claimMem(disclaimMem(mDataSize) = size); + disclaimMem(mDataSize); + mDataSize = size; + claimMem(mDataSize); } //static -- cgit v1.2.3