From 042cd4267f55c24a786834ee137ee7d1f3520180 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 19 Jun 2019 22:01:25 +0800 Subject: [PATCH] Remove upper limit of "Disk cache" setting --- src/base/bittorrent/session.cpp | 9 +++------ src/gui/advancedsettings.cpp | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 01ea6c4eb..146669d52 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -2840,22 +2840,19 @@ 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 #ifdef QBT_APP_64BIT - 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) { #ifdef QBT_APP_64BIT - 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); diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index 5def580b7..cb1a2e27c 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -342,9 +342,8 @@ void AdvancedSettings::loadAdvancedSettings() // Disk write cache spinBoxCache.setMinimum(-1); // When build as 32bit binary, set the maximum at less than 2GB to prevent crashes. - // These macros may not be available on compilers other than MSVC and GCC #ifdef QBT_APP_64BIT - spinBoxCache.setMaximum(4096); + spinBoxCache.setMaximum(33554431); // 32768GiB #else // allocate 1536MiB and leave 512MiB to the rest of program data in RAM spinBoxCache.setMaximum(1536);