pgsql: Refactor PredicateLockShmemInit to not reuse var for different t

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor PredicateLockShmemInit to not reuse var for different t
Date: 2026-03-27 11:47:59
Message-ID: E1w65fS-001grb-28@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor PredicateLockShmemInit to not reuse var for different things

The PredicateLockShmemInit function is pretty complicated, and one
source of confusion is that it reuses the same local variable for
sizes of things. Replace the different uses with separate variables
for clarity.

Reviewed-by: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/113724ab-0028-493f-9605-6e8570f0939f@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3fd0577728277e66f072f3b07adf78299dfad7cc

Modified Files
--------------
src/backend/storage/lmgr/predicate.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-27 13:27:28 pgsql: pgindent: Always clean up .BAK files from pg_bsd_indent
Previous Message Heikki Linnakangas 2026-03-27 11:12:06 pgsql: Avoid memory leak on error while parsing pg_stat_statements dump