From 105afc497a44eaad41b2d3d9db19a24b9412ddc0 Mon Sep 17 00:00:00 2001 From: siana Date: Tue, 28 Dec 2010 00:05:06 +0100 Subject: [PATCH] Revert "Cache purge queue" This reverts commit 1c37fa0fce36549bd6c939d3a9a4ad149d262a86. --- indra/newview/lltexturecache.cpp | 54 ++------------------------------ indra/newview/lltexturecache.h | 4 --- 2 files changed, 3 insertions(+), 55 deletions(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index d9763ed84..2b4781510 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -747,7 +747,6 @@ LLTextureCache::LLTextureCache(bool threaded) LLTextureCache::~LLTextureCache() { - purgeTextureFilesTimeSliced(TRUE); // VWR-3878 - NB - force-flush all pending file deletes } ////////////////////////////////////////////////////////////////////////////// @@ -1386,7 +1385,8 @@ void LLTextureCache::purgeTextures(bool validate) if (purge_entry) { purge_count++; - mFilesToDelete.push_back(filename); + LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL; + LLAPRFile::remove(filename); cache_size -= entries[idx].mBodySize; mTexturesSizeTotal -= entries[idx].mBodySize; entries[idx].mBodySize = 0; @@ -1394,8 +1394,6 @@ void LLTextureCache::purgeTextures(bool validate) } } - mTimeLastFileDelete.reset(); - LL_DEBUGS("TextureCache") << "TEXTURE CACHE: Writing Entries: " << num_entries << LL_ENDL; writeEntriesAndClose(entries); @@ -1409,53 +1407,10 @@ void LLTextureCache::purgeTextures(bool validate) LL_INFOS("TextureCache") << "TEXTURE CACHE:" << " PURGED: " << purge_count << " ENTRIES: " << num_entries - << " CACHE SIZE: " << mTexturesSizeTotal / 1024 / 1024 << " MB" + << " CACHE SIZE: " << mTexturesSizeTotal / 1024*1024 << " MB" << llendl; } -void LLTextureCache::purgeTextureFilesTimeSliced(BOOL force_all) -{ - LLMutexLock lock(&mHeaderMutex); - - F32 delay_between_passes = 1.0f; // seconds - F32 max_time_per_pass = 0.1f; // seconds - - if (!force_all && mTimeLastFileDelete.getElapsedTimeF32() <= delay_between_passes) - { - return; - } - - LLTimer timer; - S32 howmany = 0; - - if (!mFilesToDelete.empty()) - { - LL_INFOS("TEXTURE CACHE") << "purging time sliced with " << mFilesToDelete.size() << " files scheduled for deletion" << llendl; - - for (LLTextureCache::filename_list_t::iterator iter = mFilesToDelete.begin(); iter!=mFilesToDelete.end(); ) - { - LLTextureCache::filename_list_t::iterator iter2 = iter++; - LLAPRFile::remove(*iter2); - mFilesToDelete.erase(iter2); - howmany++; - - if (!force_all && timer.getElapsedTimeF32() > max_time_per_pass) - { - break; - } - } - } - - if (!mFilesToDelete.empty()) - { - LL_INFOS("TEXTURE CACHE") << "purging time sliced with " << howmany << " files deleted (" - << mFilesToDelete.size() << " files left for next pass)" - << llendl; - } - - mTimeLastFileDelete.reset(); -} - ////////////////////////////////////////////////////////////////////////////// // call lockWorkers() first! @@ -1607,9 +1562,6 @@ LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 prio purgeTextures(false); mDoPurge = FALSE; } - - purgeTextureFilesTimeSliced(); // VWR-3878 - NB - purge textures from cache in a non-hiccup-way - LLMutexLock lock(&mWorkersMutex); LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id, data, datasize, 0, diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 9f89ecda8..45804c26b 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -147,7 +147,6 @@ private: void readHeaderCache(); void purgeAllTextures(bool purge_directories); void purgeTextures(bool validate); - void purgeTextureFilesTimeSliced(BOOL force_all = FALSE); // VWR-3878 - NB LLAPRFile* openHeaderEntriesFile(bool readonly, S32 offset); void closeHeaderEntriesFile(); void readEntriesHeader(); @@ -177,9 +176,6 @@ private: typedef std::vector, bool> > responder_list_t; responder_list_t mCompletedList; - typedef std::list filename_list_t; - filename_list_t mFilesToDelete; - LLTimer mTimeLastFileDelete; BOOL mReadOnly; // HEADERS (Include first mip)