mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
commit
a8bfec081e
2 changed files with 6 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -341,7 +341,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||
// 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
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
spinBoxCache.setMaximum(4096);
|
||||
spinBoxCache.setMaximum(33554431); // 32768GiB
|
||||
#else
|
||||
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
|
||||
spinBoxCache.setMaximum(1536);
|
||||
|
@ -350,8 +350,8 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||
updateCacheSpinSuffix(spinBoxCache.value());
|
||||
addRow(DISK_CACHE, tr("Disk cache"), &spinBoxCache);
|
||||
// Disk cache expiry
|
||||
spinBoxCacheTTL.setMinimum(15);
|
||||
spinBoxCacheTTL.setMaximum(600);
|
||||
spinBoxCacheTTL.setMinimum(1);
|
||||
spinBoxCacheTTL.setMaximum(std::numeric_limits<int>::max());
|
||||
spinBoxCacheTTL.setValue(session->diskCacheTTL());
|
||||
spinBoxCacheTTL.setSuffix(tr(" s", " seconds"));
|
||||
addRow(DISK_CACHE_TTL, tr("Disk cache expiry interval"), &spinBoxCacheTTL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue