MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CalculateDbCacheBytes

Function CalculateDbCacheBytes

src/node/caches.cpp:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46size_t CalculateDbCacheBytes(const ArgsManager& args)
47{
48 if (auto db_cache{args.GetIntArg("-dbcache")}) {
49 if (*db_cache < 0) db_cache = 0;
50 const uint64_t db_cache_bytes{SaturatingLeftShift<uint64_t>(*db_cache, 20)};
51 constexpr auto max_db_cache{sizeof(void*) == 4 ? MAX_32BIT_DBCACHE : std::numeric_limits<size_t>::max()};
52 return std::max<size_t>(MIN_DB_CACHE, std::min<uint64_t>(db_cache_bytes, max_db_cache));
53 }
54 return GetDefaultDBCache();
55}
56
57CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes)
58{

Callers 2

CalculateCacheSizesFunction · 0.85
LogOversizedDbCacheFunction · 0.85

Calls 1

GetDefaultDBCacheFunction · 0.85

Tested by

no test coverage detected