public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: [email protected]
Subject: pgsql: Make FP_LOCK_SLOTS_PER_BACKEND look like a function
Date: Tue, 04 Mar 2025 17:34:32 +0000
Message-ID: <[email protected]> (raw)

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(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Make FP_LOCK_SLOTS_PER_BACKEND look like a function
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox