diff options
author | Oz Linden <oz@lindenlab.com> | 2011-01-27 09:48:51 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-01-27 09:48:51 -0500 |
commit | c44e7128212c52e8fb67a2573db4021ba400b32c (patch) | |
tree | aa6c1d0f0786a37ec08ece818df23122ac0c4c60 /indra/newview/llvocache.h | |
parent | ec0eafbaa0e4c4fbf25bab31ed38d90e998e9dbd (diff) | |
parent | a98b7003043c49bd687356843f3740f0a50ab258 (diff) |
merge changes for storm-348
Diffstat (limited to 'indra/newview/llvocache.h')
-rw-r--r-- | indra/newview/llvocache.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index e103007979..14e3b4c793 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -95,13 +95,15 @@ private: { bool operator()(const HeaderEntryInfo* lhs, const HeaderEntryInfo* rhs) const { - if (lhs->mTime == rhs->mTime) + if(lhs->mTime == rhs->mTime) { - return lhs->mHandle < rhs->mHandle; + return lhs < rhs ; } - return lhs->mTime < rhs->mTime; // older entry in front + + return lhs->mTime < rhs->mTime ; // older entry in front of queue (set) } }; + typedef std::set<HeaderEntryInfo*, header_entry_less> header_entry_queue_t; typedef std::map<U64, HeaderEntryInfo*> handle_entry_map_t; private: LLVOCache() ; @@ -114,6 +116,7 @@ public: void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ; void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache) ; + void removeEntry(U64 handle) ; void setReadOnly(BOOL read_only) {mReadOnly = read_only;} @@ -121,15 +124,14 @@ private: void setDirNames(ELLPath location); // determine the cache filename for the region from the region handle void getObjectCacheFilename(U64 handle, std::string& filename); - void removeFromCache(U64 handle); + void removeFromCache(HeaderEntryInfo* entry); void readCacheHeader(); void writeCacheHeader(); void clearCacheInMemory(); void removeCache() ; - void purgeEntries(); + void removeEntry(HeaderEntryInfo* entry) ; + void purgeEntries(U32 size); BOOL updateEntry(const HeaderEntryInfo* entry); - BOOL checkRead(LLAPRFile* apr_file, void* src, S32 n_bytes, bool remove_cache_on_error = true) ; - BOOL checkWrite(LLAPRFile* apr_file, void* src, S32 n_bytes, bool remove_cache_on_error = true) ; private: BOOL mEnabled; @@ -137,9 +139,11 @@ private: BOOL mReadOnly ; HeaderMetaInfo mMetaInfo; U32 mCacheSize; + U32 mNumEntries; std::string mHeaderFileName ; std::string mObjectCacheDirName; LLVolatileAPRPool* mLocalAPRFilePoolp ; + header_entry_queue_t mHeaderEntryQueue; handle_entry_map_t mHandleEntryMap; static LLVOCache* sInstance ; |