diff options
author | Oz Linden <oz@lindenlab.com> | 2018-05-29 11:49:46 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2018-05-29 11:49:46 -0400 |
commit | c18a4cb0117b6e865a72a01465606c67a7e3bf6d (patch) | |
tree | 25abf867eabd03b7804a1e36e9c9af2513636cc7 /indra/llimage | |
parent | 77344afa8b39b4c1fcebda4de63998a67fd4debb (diff) | |
parent | c70119ebabc4b06e2b0db02aea8c56e01fbc666e (diff) |
merge changes for 5.1.4-release
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/llimage.cpp | 36 | ||||
-rw-r--r-- | indra/llimage/llimage.h | 7 | ||||
-rw-r--r-- | indra/llimage/llimagedxt.cpp | 2 | ||||
-rw-r--r-- | indra/llimage/llimagej2c.cpp | 4 |
4 files changed, 9 insertions, 40 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); } } } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 958c9fad3d..8ec49d3f0f 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -71,7 +71,6 @@ const S32 HTTP_PACKET_SIZE = 1496; class LLImageFormatted; class LLImageRaw; class LLColor4U; -class LLPrivateMemoryPool; typedef enum e_image_codec { @@ -160,10 +159,6 @@ public: static F32 calc_download_priority(F32 virtual_size, F32 visible_area, S32 bytes_sent); static EImageCodec getCodecFromExtension(const std::string& exten); - - static void createPrivatePool() ; - static void destroyPrivatePool() ; - static LLPrivateMemoryPool* getPrivatePool() {return sPrivatePoolp;} //static LLTrace::MemStatHandle sMemStat; @@ -178,8 +173,6 @@ private: bool mBadBufferAllocation ; bool mAllowOverSize ; - - static LLPrivateMemoryPool* sPrivatePoolp ; }; // Raw representation of an image (used for textures, and other uncompressed formats diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp index 0ec83415a0..3a7319d765 100644 --- a/indra/llimage/llimagedxt.cpp +++ b/indra/llimage/llimagedxt.cpp @@ -430,7 +430,7 @@ bool LLImageDXT::convertToDXR() S32 nmips = calcNumMips(width,height); S32 total_bytes = getDataSize(); U8* olddata = getData(); - U8* newdata = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_bytes); + U8* newdata = (U8*)ll_aligned_malloc_16(total_bytes); if (!newdata) { LL_ERRS() << "Out of memory in LLImageDXT::convertToDXR()" << LL_ENDL; diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index c40df009d8..4bff21610f 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -368,7 +368,7 @@ bool LLImageJ2C::loadAndValidate(const std::string &filename) } else { - U8 *data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), file_size); + U8 *data = (U8*)ll_aligned_malloc_16(file_size); if (!data) { infile.close(); @@ -383,7 +383,7 @@ bool LLImageJ2C::loadAndValidate(const std::string &filename) if (s != APR_SUCCESS || (S32)bytes_read != file_size) { - FREE_MEM(LLImageBase::getPrivatePool(), data); + ll_aligned_free_16(data); setLastError("Unable to read entire file"); res = false; } |