HomePhabricator

init: Use size_t consistently for cache sizes

Description

init: Use size_t consistently for cache sizes

Summary:
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 concludes backport of core#31483
https://github.com/bitcoin/bitcoin/pull/31483/commits/2a92702bafca5c78b270a9502a22cb9deac02cfc
Depends on D18583

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18584

Details

Provenance
TheCharlatan <seb.kung@gmail.com>Authored on Dec 17 2024, 20:58
PiRKCommitted on Sep 10 2025, 14:58
PiRKPushed on Sep 10 2025, 14:58
Reviewer
Restricted Project
Differential Revision
D18584: init: Use size_t consistently for cache sizes
Parents
rABC5d40e193857d: kernel: Move default cache constants to caches
Branches
Unknown
Tags
Unknown