summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-05-10 21:02:20 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-05-10 21:02:20 -0600
commitb594d3b04d3095f15750436910debdd5a602a872 (patch)
treeb8c4456373a93d06d5dabc80416170bda1ad71b1 /indra/newview/lltexturefetch.cpp
parent1213e5d3548a111a39b6556c6178fc4bc655d367 (diff)
add debug mode to track the memory allocation/deallocation.
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r--indra/newview/lltexturefetch.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 806f130486..e9be45ffd0 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -816,7 +816,7 @@ void LLTextureFetchWorker::setImagePriority(F32 priority)
void LLTextureFetchWorker::resetFormattedData()
{
- LLImageBase::deleteMemory(mBuffer);
+ FREE_MEM(LLImageBase::getPrivatePool(), mBuffer);
mBuffer = NULL;
mBufferSize = 0;
if (mFormattedImage.notNull())
@@ -887,7 +887,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
mSentRequest = UNSENT;
mDecoded = FALSE;
mWritten = FALSE;
- LLImageBase::deleteMemory(mBuffer);
+ FREE_MEM(LLImageBase::getPrivatePool(), mBuffer);
mBuffer = NULL;
mBufferSize = 0;
mHaveAllData = FALSE;
@@ -1283,7 +1283,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
llassert_always(mBufferSize == cur_size + mRequestedSize);
if(!mBufferSize)//no data received.
{
- LLImageBase::deleteMemory(mBuffer);
+ FREE_MEM(LLImageBase::getPrivatePool(), mBuffer);
mBuffer = NULL;
//abort.
@@ -1311,7 +1311,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
mFileSize = mBufferSize + 1 ; //flag the file is not fully loaded.
}
- U8* buffer = (U8*)LLImageBase::allocateMemory(mBufferSize);
+ U8* buffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mBufferSize);
if (cur_size > 0)
{
memcpy(buffer, mFormattedImage->getData(), cur_size);
@@ -1320,7 +1320,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
// NOTE: setData releases current data and owns new data (buffer)
mFormattedImage->setData(buffer, mBufferSize);
// delete temp data
- LLImageBase::deleteMemory(mBuffer); // Note: not 'buffer' (assigned in setData())
+ FREE_MEM(LLImageBase::getPrivatePool(), mBuffer); // Note: not 'buffer' (assigned in setData())
mBuffer = NULL;
mBufferSize = 0;
mLoadedDiscard = mRequestedDiscard;
@@ -1617,7 +1617,7 @@ bool LLTextureFetchWorker::processSimulatorPackets()
if (buffer_size > cur_size)
{
/// We have new data
- U8* buffer = (U8*)LLImageBase::allocateMemory(buffer_size);
+ U8* buffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), buffer_size);
S32 offset = 0;
if (cur_size > 0 && mFirstPacket > 0)
{
@@ -1669,7 +1669,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
if (data_size > 0)
{
// *TODO: set the formatted image data here directly to avoid the copy
- mBuffer = (U8*)LLImageBase::allocateMemory(data_size);
+ mBuffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), data_size);
buffer->readAfter(channels.in(), NULL, mBuffer, data_size);
mBufferSize += data_size;
if (data_size < mRequestedSize && mRequestedDiscard == 0)