diff options
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rwxr-xr-x | indra/llimage/llimage.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 1c25256e95..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" //--------------------------------------------------------------------------- @@ -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) @@ -158,8 +159,8 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; + memDisclaimAmount(mDataSize) = 0; mData = NULL; - mDataSize = 0; } // virtual @@ -201,6 +202,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; + memClaimAmount(mDataSize); } return mData; @@ -222,7 +224,7 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - mDataSize = size; + memClaimAmount(memDisclaimAmount(mDataSize) = size); return mData; } @@ -288,7 +290,6 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy) : LLImageBase() { - if(no_copy) { setDataAndSize(data, width, height, components); @@ -1608,7 +1609,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); - mData = data; mDataSize = size; + mData = data; + memClaimAmount(memDisclaimAmount(mDataSize) = size); } //static |