From 6a8b63e9de7ee78db2e24ed77f855c1e19790af2 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Sun, 7 Mar 2010 21:18:10 -0700 Subject: partial fix for EXT-5711: Some textures loading from cache seems jammed. This fix should be able to improve the speed of loading texturs from cache noticeably (30% or more). More fix to come. --- indra/newview/lltexturecache.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/lltexturecache.h') diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 64ec881fc3..b840619c1f 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -68,6 +68,7 @@ private: Entry(const LLUUID& id, S32 imagesize, S32 bodysize, U32 time) : mID(id), mImageSize(imagesize), mBodySize(bodysize), mTime(time) {} void init(const LLUUID& id, U32 time) { mID = id, mImageSize = 0; mBodySize = 0; mTime = time; } + Entry& operator=(const Entry& entry) {mID = entry.mID, mImageSize = entry.mImageSize; mBodySize = entry.mBodySize; mTime = entry.mTime; return *this;} LLUUID mID; // 16 bytes S32 mImageSize; // total size of image if known S32 mBodySize; // size of body file in body cache @@ -166,6 +167,8 @@ private: S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); bool removeHeaderCacheEntry(const LLUUID& id); + void writeUpdatedEntries() ; + void updatedHeaderEntriesFile() ; void lockHeaders() { mHeaderMutex.lock(); } void unlockHeaders() { mHeaderMutex.unlock(); } @@ -204,6 +207,9 @@ private: S64 mTexturesSizeTotal; LLAtomic32 mDoPurge; + typedef std::map idx_entry_map_t; + idx_entry_map_t mUpdatedEntryMap; + // Statics static F32 sHeaderCacheVersion; static U32 sCacheMaxEntries; -- cgit v1.2.3 From f8dc23fc84e624845181315bbadcbdc1f804c628 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 17 Mar 2010 12:39:39 -0600 Subject: fix for EXT-6093: crash at LLTextureCache::updateTextureEntryList[secondlife-bin lltexturecache.cpp:847]; EXT-5711: Some textures loading from cache seems jammed; EXT-5599: Viewer crashes consistently, in Linden Homes region. --- indra/newview/lltexturecache.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltexturecache.h') diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index b840619c1f..ca8815ee7e 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -123,7 +123,7 @@ public: bool writeComplete(handle_t handle, bool abort = false); void prioritizeWrite(handle_t handle); - void removeFromCache(const LLUUID& id); + bool removeFromCache(const LLUUID& id); // For LLTextureCacheWorker::Responder LLTextureCacheWorker* getReader(handle_t handle); @@ -161,12 +161,16 @@ private: void readEntriesHeader(); void writeEntriesHeader(); S32 openAndReadEntry(const LLUUID& id, Entry& entry, bool create); - void writeEntryAndClose(S32 idx, Entry& entry); + void updateEntry(S32 idx, Entry& entry, S32 new_image_size, S32 new_body_size); + void updateEntryTimeStamp(S32 idx, Entry& entry) ; U32 openAndReadEntries(std::vector& entries); void writeEntriesAndClose(const std::vector& entries); + void readEntryFromHeaderImmediately(S32 idx, Entry& entry) ; + void writeEntryToHeaderImmediately(S32 idx, Entry& entry, bool write_header = false) ; + void removeEntry(S32 idx, Entry& entry, std::string& filename); + void removeCachedTexture(const LLUUID& id) ; S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); - bool removeHeaderCacheEntry(const LLUUID& id); void writeUpdatedEntries() ; void updatedHeaderEntriesFile() ; void lockHeaders() { mHeaderMutex.lock(); } -- cgit v1.2.3