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.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 2e54d3de39..c02105f82c 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -39,10 +39,6 @@
#include "llappviewer.h"
#include "llmemory.h"
-#if LL_WINDOWS
-#pragma optimize("", off)
-#endif
-
// Cache organization:
// cache/texture.entries
// Unordered array of Entry structs
@@ -1229,8 +1225,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create
{
readEntryFromHeaderImmediately(idx, entry) ;
}
- llassert(entry.mImageSize < 0 || entry.mImageSize > entry.mBodySize);
- /*if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why
+ if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why
{
LL_WARNS() << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << LL_ENDL ;
@@ -1239,7 +1234,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create
removeEntry(idx, entry, tex_filename) ;
mUpdatedEntryMap.erase(idx) ;
idx = -1 ;
- }*/
+ }
}
return idx;
}
@@ -1267,12 +1262,12 @@ void LLTextureCache::writeEntryToHeaderImmediately(S32& idx, Entry& entry, bool
{
aprfile = openHeaderEntriesFile(false, offset);
}
- llassert(entry.mImageSize > entry.mBodySize);
bytes_written = aprfile->write((void*)&entry, (S32)sizeof(Entry));
if(bytes_written != sizeof(Entry))
{
clearCorruptedCache() ; //clear the cache.
idx = -1 ;//mark the idx invalid.
+
return ;
}
@@ -1319,8 +1314,6 @@ void LLTextureCache::updateEntryTimeStamp(S32 idx, Entry& entry)
//update an existing entry, write to header file immediately.
bool LLTextureCache::updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 new_data_size)
{
- llassert(new_image_size >= new_data_size);
-
S32 new_body_size = llmax(0, new_data_size - TEXTURE_CACHE_ENTRY_SIZE) ;
if(new_image_size == entry.mImageSize && new_body_size == entry.mBodySize)
@@ -1409,10 +1402,6 @@ U32 LLTextureCache::openAndReadEntries(std::vector<Entry>& entries)
}
entries.push_back(entry);
// LL_INFOS() << "ENTRY: " << entry.mTime << " TEX: " << entry.mID << " IDX: " << idx << " Size: " << entry.mImageSize << LL_ENDL;
- if(entry.mImageSize < 0)
- {
- mFreeList.insert(idx);
- }
if(entry.mImageSize > entry.mBodySize)
{
mHeaderIDMap[entry.mID] = idx;
@@ -1837,8 +1826,6 @@ S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, Entry& entry)
// Writes imagesize to the header, updates timestamp
S32 LLTextureCache::setHeaderCacheEntry(const LLUUID& id, Entry& entry, S32 imagesize, S32 datasize)
{
- llassert(imagesize >= datasize);
-
mHeaderMutex.lock();
S32 idx = openAndReadEntry(id, entry, true); // read or create
mHeaderMutex.unlock();