mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
init: Use size_t consistently for cache sizes
This avoids having to rely on implicit casts when passing them to the various functions allocating the caches. This also ensures that if the requested amount of db_cache does not fit in a size_t, it is clamped to the maximum value of a size_t. Also take this opportunity to make the total amounts of cache in the chainstate manager a size_t too.
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
//! Suggested default amount of cache reserved for the kernel (MiB)
|
||||
static constexpr int64_t DEFAULT_KERNEL_CACHE{450};
|
||||
//! Suggested default amount of cache reserved for the kernel (bytes)
|
||||
static constexpr size_t DEFAULT_KERNEL_CACHE{450_MiB};
|
||||
//! Max memory allocated to block tree DB specific cache (bytes)
|
||||
static constexpr size_t MAX_BLOCK_DB_CACHE{2_MiB};
|
||||
//! Max memory allocated to coin DB specific cache (bytes)
|
||||
|
||||
Reference in New Issue
Block a user