summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2020-10-07 15:25:12 -0700
committerCallum Prentice <callum@gmail.com>2020-10-07 15:25:12 -0700
commit08dfc0836fb12855d0c07d811e2909400d5b74f3 (patch)
tree383c203f7084086ae5e3804cd126dc32c4048516 /indra/newview
parenta0ea119623b8bda445f86afdb0ea7b5833c8e171 (diff)
This changeset hooks up many things that have been in progress and moves things about between llfilesystem and lldiskcache - there is still some bookkeeping work left but this is the first version that appears to work and actively manage the cache
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml26
-rw-r--r--indra/newview/llappviewer.cpp15
2 files changed, 34 insertions, 7 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0123bc32af..2e65aef9a2 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1351,10 +1351,10 @@
<key>Value</key>
<integer>23</integer>
</map>
- <key>CacheDebugInfo</key>
+ <key>EnableCacheDebugInfo</key>
<map>
<key>Comment</key>
- <string>When enabled, display additional cache debugging information</string>
+ <string>When set, display additional cache debugging information</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -1362,6 +1362,28 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>DiskCacheMaxSizeMB</key>
+ <map>
+ <key>Comment</key>
+ <string>The maximum number of MB to use for the new disk cache</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>10</integer>
+ </map>
+ <key>DiskCacheDirName</key>
+ <map>
+ <key>Comment</key>
+ <string>The name of the disk cache (within the standard Viewer disk cache directory)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>dcache</string>
+ </map>
<key>CacheLocation</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 0d25cb6dc8..1914ca89de 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -98,6 +98,7 @@
#include "lllogininstance.h"
#include "llprogressview.h"
#include "llvocache.h"
+#include "lldiskcache.h"
#include "llvopartgroup.h"
#include "llweb.h"
#include "llfloatertexturefetchdebugger.h"
@@ -115,7 +116,6 @@
#include "llprimitive.h"
#include "llurlaction.h"
#include "llurlentry.h"
-#include "llfilesystem.h"
#include "llvolumemgr.h"
#include "llxfermanager.h"
#include "llphysicsextensions.h"
@@ -1855,9 +1855,6 @@ bool LLAppViewer::cleanup()
SUBSYSTEM_CLEANUP(LLWorldMapView);
SUBSYSTEM_CLEANUP(LLFolderViewItem);
- LL_INFOS() << "Cleaning up disk cache" << LL_ENDL;
- SUBSYSTEM_CLEANUP(LLFileSystem);
-
LL_INFOS() << "Saving Data" << LL_ENDL;
// Store the time of our current logoff
@@ -4111,6 +4108,9 @@ bool LLAppViewer::initCache()
{
LLSplashScreen::update(LLTrans::getString("StartupClearingCache"));
purgeCache();
+
+ // purge the new C++ file system based cache
+ LLDiskCache::getInstance()->purge();
}
LLSplashScreen::update(LLTrans::getString("StartupInitializingTextureCache"));
@@ -4131,7 +4131,12 @@ bool LLAppViewer::initCache()
LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion());
- LLFileSystem::initClass();
+ // initialize the new disk cache using saved settings
+ const std::string cache_dir_name = gSavedSettings.getString("DiskCacheDirName");
+ const unsigned int cache_max_bytes = gSavedSettings.getU32("DiskCacheMaxSizeMB") * 1024 * 1024;
+ const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo");
+ const std::string cache_dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, cache_dir_name);
+ LLDiskCache::initParamSingleton(cache_dir, cache_max_bytes, enable_cache_debug_info);
return true;
}