Allow to use POSIX-compliant disk IO type

This patch allows user to switch disk IO type between memory mapped files based type (default in libtorrent 2, and seems causing memory issues) and POSIX-compliant type which is more conservative on memory usage.

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Vladimir Golovnev (Glassez) <glassez@yandex.ru>

PR #16895.
This commit is contained in:
Coda 2022-05-11 11:28:06 -07:00 committed by GitHub
parent a048ea668f
commit e698c09298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 90 additions and 1 deletions

View file

@ -315,6 +315,8 @@ void AppController::preferencesAction()
data[u"disk_cache_ttl"_qs] = session->diskCacheTTL();
// Disk queue size
data[u"disk_queue_size"_qs] = session->diskQueueSize();
// Disk IO Type
data[u"disk_io_type"_qs] = static_cast<int>(session->diskIOType());
// Enable OS cache
data[u"enable_os_cache"_qs] = session->useOSCache();
// Coalesce reads & writes
@ -799,6 +801,9 @@ void AppController::setPreferencesAction()
// Disk queue size
if (hasKey(u"disk_queue_size"_qs))
session->setDiskQueueSize(it.value().toLongLong());
// Disk IO Type
if (hasKey(u"disk_io_type"_qs))
session->setDiskIOType(static_cast<BitTorrent::DiskIOType>(it.value().toInt()));
// Enable OS cache
if (hasKey(u"enable_os_cache"_qs))
session->setUseOSCache(it.value().toBool());