mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Remove upper limit of "Disk cache" setting
This commit is contained in:
parent
1831f71cc4
commit
042cd4267f
2 changed files with 4 additions and 8 deletions
|
@ -2840,22 +2840,19 @@ void Session::setCheckingMemUsage(int size)
|
||||||
|
|
||||||
int Session::diskCacheSize() const
|
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
|
#ifdef QBT_APP_64BIT
|
||||||
size = qMin(size, 4096); // 4GiB
|
return qMin(m_diskCacheSize.value(), 33554431); // 32768GiB
|
||||||
#else
|
#else
|
||||||
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes
|
// 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
|
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
|
||||||
size = qMin(size, 1536);
|
return qMin(m_diskCacheSize.value(), 1536);
|
||||||
#endif
|
#endif
|
||||||
return size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setDiskCacheSize(int size)
|
void Session::setDiskCacheSize(int size)
|
||||||
{
|
{
|
||||||
#ifdef QBT_APP_64BIT
|
#ifdef QBT_APP_64BIT
|
||||||
size = qMin(size, 4096); // 4GiB
|
size = qMin(size, 33554431); // 32768GiB
|
||||||
#else
|
#else
|
||||||
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
|
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
|
||||||
size = qMin(size, 1536);
|
size = qMin(size, 1536);
|
||||||
|
|
|
@ -342,9 +342,8 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||||
// Disk write cache
|
// Disk write cache
|
||||||
spinBoxCache.setMinimum(-1);
|
spinBoxCache.setMinimum(-1);
|
||||||
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes.
|
// 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
|
#ifdef QBT_APP_64BIT
|
||||||
spinBoxCache.setMaximum(4096);
|
spinBoxCache.setMaximum(33554431); // 32768GiB
|
||||||
#else
|
#else
|
||||||
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
|
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
|
||||||
spinBoxCache.setMaximum(1536);
|
spinBoxCache.setMaximum(1536);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue