pgsql: Make FP_LOCK_SLOTS_PER_BACKEND look like a function

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make FP_LOCK_SLOTS_PER_BACKEND look like a function
Date: 2025-03-04 17:34:32
Message-ID: E1tpWA4-000m9L-1D@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make FP_LOCK_SLOTS_PER_BACKEND look like a function

The FP_LOCK_SLOTS_PER_BACKEND macro looks like a constant, but it
depends on the max_locks_per_transaction GUC, and thus can change. This
is non-obvious and confusing, so make it look more like a function by
renaming it to FastPathLockSlotsPerBackend().

While at it, use the macro when initializing fast-path shared memory,
instead of using the formula.

Reported-by: Andres Freund
Discussion: https://postgr.es/m/ffiwtzc6vedo6wb4gbwelon5nefqg675t5c7an2ta7pcz646cg%40qwmkdb3l4ett

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c878de1db438f9f4747374c286d4319cc527eec2

Modified Files
--------------
src/backend/storage/lmgr/lock.c | 10 +++++-----
src/backend/storage/lmgr/proc.c | 4 ++--
src/backend/utils/init/postinit.c | 2 +-
src/include/storage/proc.h | 3 ++-
4 files changed, 10 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-03-04 17:35:42 Re: pgsql: Generalize hash and ordering support in amapi
Previous Message Mark Dilger 2025-03-04 17:23:49 Re: pgsql: Generalize hash and ordering support in amapi