scripted-diff: use MIN_DBCACHE_BYTES

-BEGIN VERIFY SCRIPT-
git grep -q '\bMIN_DBCACHE_BYTES\b' -- src && echo "Error: renamed dbcache byte constant already exists in src" && exit 1
git grep -l 'MIN_DB_CACHE' -- src | xargs perl -pi -e 's/\bMIN_DB_CACHE\b/MIN_DBCACHE_BYTES/g'
-END VERIFY SCRIPT-

Co-authored-by: optout <13562139+optout21@users.noreply.github.com>
This commit is contained in:
Lőrinc
2026-05-03 15:16:39 +02:00
parent ab63432576
commit 7cfa21d60a
5 changed files with 5 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ uint64_t CalculateDbCacheBytes(const ArgsManager& args)
if (*db_cache < 0) db_cache = 0;
const uint64_t db_cache_bytes{SaturatingLeftShift<uint64_t>(*db_cache, 20)};
constexpr uint64_t max_db_cache{sizeof(void*) == 4 ? MAX_32BIT_DBCACHE : std::numeric_limits<uint64_t>::max()};
return std::max<uint64_t>(MIN_DB_CACHE, std::min<uint64_t>(db_cache_bytes, max_db_cache));
return std::max<uint64_t>(MIN_DBCACHE_BYTES, std::min<uint64_t>(db_cache_bytes, max_db_cache));
}
return GetDefaultDBCache();
}

View File

@@ -15,7 +15,7 @@
class ArgsManager;
//! min. -dbcache (bytes)
static constexpr uint64_t MIN_DB_CACHE{4_MiB};
static constexpr uint64_t MIN_DBCACHE_BYTES{4_MiB};
//! -dbcache default (bytes)
static constexpr uint64_t DEFAULT_DB_CACHE{DEFAULT_KERNEL_CACHE};
//! Reserved non-dbcache memory usage.