Remove upper limit of "Disk cache" setting

This commit is contained in:
Chocobo1
2019-06-19 22:01:25 +08:00
parent bcee784097
commit c599976b6f
2 changed files with 4 additions and 6 deletions

View File

@@ -3113,22 +3113,20 @@ void Session::setCheckingMemUsage(int size)
int Session::diskCacheSize() const
{
int size = m_diskCacheSize;
// These macros may not be available on compilers other than MSVC and GCC
#if defined(__x86_64__) || defined(_M_X64)
size = qMin(size, 4096); // 4GiB
return qMin(m_diskCacheSize.value(), 33554431); // 32768GiB
#else
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
size = qMin(size, 1536);
return qMin(m_diskCacheSize.value(), 1536);
#endif
return size;
}
void Session::setDiskCacheSize(int size)
{
#if defined(__x86_64__) || defined(_M_X64)
size = qMin(size, 4096); // 4GiB
size = qMin(size, 33554431); // 32768GiB
#else
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
size = qMin(size, 1536);