bufmgr: Make it easier to change number of buffer state bits
authorAndres Freund <andres@anarazel.de>
Mon, 24 Feb 2025 10:39:17 +0000 (05:39 -0500)
committerAndres Freund <andres@anarazel.de>
Mon, 24 Feb 2025 11:23:41 +0000 (06:23 -0500)
commit418451bfe161e4b86c29f098e4d93b2347d35774
tree99b9aeff2f479bf48dc5680eff7e7f882391b250
parentcd3ccf88aacb43b7232d6834dc886ff8538c6ce8
bufmgr: Make it easier to change number of buffer state bits

In an upcoming commit I'd like to change the number of bits for the usage
count (the current max is 5, fitting in three bits, but we reserve four
bits). Until now that required adjusting a bunch of magic constants, now the
constants are defined based on the number of bits reserved.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/lxzj26ga6ippdeunz6kuncectr5gfuugmm2ry22qu6hcx6oid6@lzx3sjsqhmt6
Discussion: https://postgr.es/m/riivolmg6uzfvpzfn6wjo3ghwt42rcec43ok6mv4oenfg654y7@x7dbposbskwd
src/include/storage/buf_internals.h