summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturecache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rw-r--r--indra/newview/lltexturecache.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 11dff69e0c..b6e396a96f 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -113,7 +113,7 @@ public:
~LLTextureCacheWorker()
{
llassert_always(!haveWork());
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
}
// override this interface
@@ -215,7 +215,7 @@ bool LLTextureCacheLocalFileWorker::doRead()
mDataSize = 0;
return true;
}
- mReadData = (U8*)LLImageBase::allocateMemory(mDataSize);
+ mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize);
mBytesRead = -1;
mBytesToRead = mDataSize;
setPriority(LLWorkerThread::PRIORITY_LOW | mPriority);
@@ -233,7 +233,7 @@ bool LLTextureCacheLocalFileWorker::doRead()
// << " Bytes: " << mDataSize << " Offset: " << mOffset
// << " / " << mDataSize << llendl;
mDataSize = 0; // failed
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
}
return true;
@@ -248,7 +248,7 @@ bool LLTextureCacheLocalFileWorker::doRead()
{
mDataSize = local_size;
}
- mReadData = (U8*)LLImageBase::allocateMemory(mDataSize);
+ mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize);
S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize);
@@ -258,7 +258,7 @@ bool LLTextureCacheLocalFileWorker::doRead()
// << " Bytes: " << mDataSize << " Offset: " << mOffset
// << " / " << mDataSize << llendl;
mDataSize = 0;
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
}
else
@@ -377,7 +377,7 @@ bool LLTextureCacheRemoteWorker::doRead()
mDataSize = local_size;
}
// Allocate read buffer
- mReadData = (U8*)LLImageBase::allocateMemory(mDataSize);
+ mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize);
S32 bytes_read = LLAPRFile::readEx(local_filename, mReadData, mOffset, mDataSize);
if (bytes_read != mDataSize)
{
@@ -385,7 +385,7 @@ bool LLTextureCacheRemoteWorker::doRead()
<< " Bytes: " << mDataSize << " Offset: " << mOffset
<< " / " << mDataSize << llendl;
mDataSize = 0;
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
}
else
@@ -428,14 +428,14 @@ bool LLTextureCacheRemoteWorker::doRead()
S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
size = llmin(size, mDataSize);
// Allocate the read buffer
- mReadData = (U8*)LLImageBase::allocateMemory(size);
+ mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), size);
S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, mReadData, offset, size);
if (bytes_read != size)
{
llwarns << "LLTextureCacheWorker: " << mID
<< " incorrect number of bytes read from header: " << bytes_read
<< " / " << size << llendl;
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
mDataSize = -1; // failed
done = true;
@@ -465,7 +465,7 @@ bool LLTextureCacheRemoteWorker::doRead()
S32 data_offset, file_size, file_offset;
// Reserve the whole data buffer first
- U8* data = (U8*)LLImageBase::allocateMemory(mDataSize);
+ U8* data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize);
// Set the data file pointers taking the read offset into account. 2 cases:
if (mOffset < TEXTURE_CACHE_ENTRY_SIZE)
@@ -478,7 +478,7 @@ bool LLTextureCacheRemoteWorker::doRead()
// Copy the raw data we've been holding from the header cache into the new sized buffer
llassert_always(mReadData);
memcpy(data, mReadData, data_offset);
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
}
else
@@ -503,7 +503,7 @@ bool LLTextureCacheRemoteWorker::doRead()
llwarns << "LLTextureCacheWorker: " << mID
<< " incorrect number of bytes read from body: " << bytes_read
<< " / " << file_size << llendl;
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
mDataSize = -1; // failed
done = true;
@@ -595,11 +595,11 @@ bool LLTextureCacheRemoteWorker::doWrite()
{
// We need to write a full record in the header cache so, if the amount of data is smaller
// than a record, we need to transfer the data to a buffer padded with 0 and write that
- U8* padBuffer = (U8*)LLImageBase::allocateMemory(TEXTURE_CACHE_ENTRY_SIZE);
+ U8* padBuffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), TEXTURE_CACHE_ENTRY_SIZE);
memset(padBuffer, 0, TEXTURE_CACHE_ENTRY_SIZE); // Init with zeros
memcpy(padBuffer, mWriteData, mDataSize); // Copy the write buffer
bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size);
- LLImageBase::deleteMemory(padBuffer);
+ FREE_MEM(LLImageBase::getPrivatePool(), padBuffer);
}
else
{
@@ -694,7 +694,7 @@ void LLTextureCacheWorker::finishWork(S32 param, bool completed)
}
else
{
- LLImageBase::deleteMemory(mReadData);
+ FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
}
}