summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-12-18 00:58:26 -0800
committerRichard Linden <none@none>2012-12-18 00:58:26 -0800
commit1f56e57008f5a50c9e75fc0b4512c483ac359a52 (patch)
tree6631b12beaf3cf64e093730e9c93df34b883472c /indra/llimage
parent8c2e3bea71ea15b805a9e2a288744f10d195d803 (diff)
SH-3468 WIP add memory tracking base class
created memory tracking trace type instrumented a few classes with memory tracking
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimage.cpp8
-rw-r--r--indra/llimage/llimage.h5
2 files changed, 11 insertions, 2 deletions
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
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index b87ce6f060..d945d54404 100644
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -30,6 +30,7 @@
#include "lluuid.h"
#include "llstring.h"
#include "llthread.h"
+#include "lltrace.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
const S32 MAX_IMAGE_MIP = 11; // 2048x2048
@@ -110,7 +111,9 @@ protected:
//============================================================================
// Image base class
-class LLImageBase : public LLThreadSafeRefCount
+class LLImageBase
+: public LLThreadSafeRefCount,
+ public LLTrace::MemTrackable<LLImageBase>
{
protected:
virtual ~LLImageBase();