diff options
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rw-r--r-- | indra/llimage/llimage.cpp | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 4a76d15096..dca03cfe04 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -588,7 +588,6 @@ std::string LLImage::sLastErrorMessage; LLMutex* LLImage::sMutex = NULL; bool LLImage::sUseNewByteRange = false; S32 LLImage::sMinimalReverseByteRangePercent = 75; -LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; //static void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) @@ -596,8 +595,6 @@ void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_ sUseNewByteRange = use_new_byte_range; sMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent; sMutex = new LLMutex(NULL); - - LLImageBase::createPrivatePool() ; } //static @@ -605,8 +602,6 @@ void LLImage::cleanupClass() { delete sMutex; sMutex = NULL; - - LLImageBase::destroyPrivatePool() ; } //static @@ -644,25 +639,6 @@ LLImageBase::~LLImageBase() deleteData(); // virtual } -//static -void LLImageBase::createPrivatePool() -{ - if(!sPrivatePoolp) - { - sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC_THREADED) ; - } -} - -//static -void LLImageBase::destroyPrivatePool() -{ - if(sPrivatePoolp) - { - LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp) ; - sPrivatePoolp = NULL ; - } -} - // virtual void LLImageBase::dump() { @@ -696,7 +672,7 @@ void LLImageBase::sanityCheck() // virtual void LLImageBase::deleteData() { - FREE_MEM(sPrivatePoolp, mData) ; + ll_aligned_free_16(mData); disclaimMem(mDataSize); mDataSize = 0; mData = NULL; @@ -736,7 +712,7 @@ U8* LLImageBase::allocateData(S32 size) if (!mBadBufferAllocation && (!mData || size != mDataSize)) { deleteData(); // virtual - mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); + mData = (U8*)ll_aligned_malloc_16(size); if (!mData) { LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL; @@ -763,7 +739,7 @@ U8* LLImageBase::allocateData(S32 size) // virtual U8* LLImageBase::reallocateData(S32 size) { - U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); + U8 *new_datap = (U8*)ll_aligned_malloc_16(size); if (!new_datap) { LL_WARNS() << "Out of memory in LLImageBase::reallocateData" << LL_ENDL; @@ -773,7 +749,7 @@ U8* LLImageBase::reallocateData(S32 size) { S32 bytes = llmin(mDataSize, size); memcpy(new_datap, mData, bytes); /* Flawfinder: ignore */ - FREE_MEM(sPrivatePoolp, mData) ; + ll_aligned_free_16(mData) ; } mData = new_datap; disclaimMem(mDataSize); @@ -1470,7 +1446,7 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) if (new_data_size > 0) { - U8 *new_data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), new_data_size); + U8 *new_data = (U8*)ll_aligned_malloc_16(new_data_size); if(NULL == new_data) { return false; @@ -2169,7 +2145,7 @@ void LLImageFormatted::appendData(U8 *data, S32 size) S32 newsize = cursize + size; reallocateData(newsize); memcpy(getData() + cursize, data, size); - FREE_MEM(LLImageBase::getPrivatePool(), data); + ll_aligned_free_16(data); } } } |