diff options
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rw-r--r-- | indra/newview/lltexturecache.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index dadf2f9701..2a0d961952 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -117,7 +117,7 @@ public: ~LLTextureCacheWorker() { llassert_always(!haveWork()); - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); } // override this interface @@ -237,7 +237,7 @@ bool LLTextureCacheLocalFileWorker::doRead() // << " Bytes: " << mDataSize << " Offset: " << mOffset // << " / " << mDataSize << LL_ENDL; mDataSize = 0; // failed - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; } return true; @@ -252,7 +252,7 @@ bool LLTextureCacheLocalFileWorker::doRead() { mDataSize = local_size; } - mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize); + mReadData = (U8*)ll_aligned_malloc_16(mDataSize); S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); @@ -262,7 +262,7 @@ bool LLTextureCacheLocalFileWorker::doRead() // << " Bytes: " << mDataSize << " Offset: " << mOffset // << " / " << mDataSize << LL_ENDL; mDataSize = 0; - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; } else @@ -386,7 +386,7 @@ bool LLTextureCacheRemoteWorker::doRead() mDataSize = local_size; } // Allocate read buffer - mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize); + mReadData = (U8*)ll_aligned_malloc_16(mDataSize); if (mReadData) { @@ -402,7 +402,7 @@ bool LLTextureCacheRemoteWorker::doRead() << " Bytes: " << mDataSize << " Offset: " << mOffset << " / " << mDataSize << LL_ENDL; mDataSize = 0; - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; } else @@ -451,7 +451,7 @@ bool LLTextureCacheRemoteWorker::doRead() S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset; size = llmin(size, mDataSize); // Allocate the read buffer - mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), size); + mReadData = (U8*)ll_aligned_malloc_16(size); if (mReadData) { S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, @@ -461,7 +461,7 @@ bool LLTextureCacheRemoteWorker::doRead() LL_WARNS() << "LLTextureCacheWorker: " << mID << " incorrect number of bytes read from header: " << bytes_read << " / " << size << LL_ENDL; - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; mDataSize = -1; // failed done = true; @@ -500,7 +500,7 @@ bool LLTextureCacheRemoteWorker::doRead() S32 data_offset, file_size, file_offset; // Reserve the whole data buffer first - U8* data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), mDataSize); + U8* data = (U8*)ll_aligned_malloc_16(mDataSize); if (data) { // Set the data file pointers taking the read offset into account. 2 cases: @@ -514,7 +514,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); - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; } else @@ -540,7 +540,7 @@ bool LLTextureCacheRemoteWorker::doRead() LL_WARNS() << "LLTextureCacheWorker: " << mID << " incorrect number of bytes read from body: " << bytes_read << " / " << file_size << LL_ENDL; - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; mDataSize = -1; // failed done = true; @@ -550,7 +550,7 @@ bool LLTextureCacheRemoteWorker::doRead() { LL_WARNS() << "LLTextureCacheWorker: " << mID << " failed to allocate memory for reading: " << mDataSize << LL_ENDL; - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; mDataSize = -1; // failed done = true; @@ -673,11 +673,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*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), TEXTURE_CACHE_ENTRY_SIZE); + U8* padBuffer = (U8*)ll_aligned_malloc_16(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, mCache->getLocalAPRFilePool()); - FREE_MEM(LLImageBase::getPrivatePool(), padBuffer); + ll_aligned_free_16(padBuffer); } else { @@ -783,7 +783,7 @@ void LLTextureCacheWorker::finishWork(S32 param, bool completed) } else { - FREE_MEM(LLImageBase::getPrivatePool(), mReadData); + ll_aligned_free_16(mReadData); mReadData = NULL; } } @@ -845,7 +845,7 @@ LLTextureCache::~LLTextureCache() writeUpdatedEntries() ; delete mFastCachep; delete mFastCachePoolp; - FREE_MEM(LLImageBase::getPrivatePool(), mFastCachePadBuffer); + ll_aligned_free_16(mFastCachePadBuffer); } ////////////////////////////////////////////////////////////////////////////// @@ -1983,10 +1983,10 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d } discardlevel = head[3]; - data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), image_size); + data = (U8*)ll_aligned_malloc_16(image_size); if(mFastCachep->read(data, image_size) != image_size) { - FREE_MEM(LLImageBase::getPrivatePool(), data); + ll_aligned_free_16(data); closeFastCache(); return NULL; } @@ -2078,7 +2078,7 @@ void LLTextureCache::openFastCache(bool first_time) { if(!mFastCachePadBuffer) { - mFastCachePadBuffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), TEXTURE_FAST_CACHE_ENTRY_SIZE); + mFastCachePadBuffer = (U8*)ll_aligned_malloc_16(TEXTURE_FAST_CACHE_ENTRY_SIZE); } mFastCachePoolp = new LLVolatileAPRPool(); if (LLAPRFile::isExist(mFastCacheFileName, mFastCachePoolp)) |