mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
fixup! Better handle 32-bit platforms by limitting database size
This commit is contained in:
parent
702d7e620f
commit
fb2e019591
1 changed files with 5 additions and 4 deletions
|
@ -47,16 +47,17 @@ static const std::string_view CACHE_FORMAT_VERSION_KEY("cache_format_version");
|
||||||
static const std::string_view CURRENT_ONLINE_BACKUP_VERSION("current_online_backup_version");
|
static const std::string_view CURRENT_ONLINE_BACKUP_VERSION("current_online_backup_version");
|
||||||
|
|
||||||
constexpr auto MAX_DBS = 32384UL;
|
constexpr auto MAX_DBS = 32384UL;
|
||||||
#if Q_PROCESSOR_WORDSIZE == 8 // 64-bit
|
constexpr auto BATCH_SIZE = 100;
|
||||||
|
|
||||||
|
#if Q_PROCESSOR_WORDSIZE >= 5 // 40-bit or more, up to 2^(8*WORDSIZE) words addressable.
|
||||||
constexpr auto DB_SIZE = 32ULL * 1024ULL * 1024ULL * 1024ULL; // 32 GB
|
constexpr auto DB_SIZE = 32ULL * 1024ULL * 1024ULL * 1024ULL; // 32 GB
|
||||||
constexpr size_t MAX_RESTORED_MESSAGES = 30'000;
|
constexpr size_t MAX_RESTORED_MESSAGES = 30'000;
|
||||||
#elif Q_PROCESSOR_WORDSIZE == 4 // 32-bit address space limits mmaps
|
#elif Q_PROCESSOR_WORDSIZE == 4 // 32-bit address space limits mmaps
|
||||||
constexpr auto DB_SIZE = 1ULL * 1024ULL * 1024ULL * 1024ULL; // 1 GB
|
constexpr auto DB_SIZE = 1ULL * 1024ULL * 1024ULL * 1024ULL; // 1 GB
|
||||||
constexpr size_t MAX_RESTORED_MESSAGES = 5'000;
|
constexpr size_t MAX_RESTORED_MESSAGES = 5'000;
|
||||||
#else
|
#else
|
||||||
#error unknown word size on target CPU
|
#error Not enough virtual address space for the database on target CPU
|
||||||
#endif
|
#endif
|
||||||
constexpr auto BATCH_SIZE = 100;
|
|
||||||
|
|
||||||
//! Cache databases and their format.
|
//! Cache databases and their format.
|
||||||
//!
|
//!
|
||||||
|
|
Loading…
Reference in a new issue