Re: lwlocknames.h beautification attempt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gurjeet Singh <gurjeet(at)singh(dot)im>
Cc: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: lwlocknames.h beautification attempt
Date: 2025-03-02 06:26:07
Message-ID: 3128012.1740896767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gurjeet Singh <gurjeet(at)singh(dot)im> writes:
> I propose the following change to the generation script,
> generate-lwlocknames.pl
> ...
> which produces the lock names in this format

> #define ShmemIndexLock (&MainLWLockArray[1].lock)
> #define OidGenLock (&MainLWLockArray[2].lock)
> #define XidGenLock (&MainLWLockArray[3].lock)
> #define ProcArrayLock (&MainLWLockArray[4].lock)
> #define SInvalReadLock (&MainLWLockArray[5].lock)

This looks reasonably in line with project style ...

> Yet another format, which I prefer, can be achieved by right-aligning the
> lock names.

> #define ShmemIndexLock (&MainLWLockArray[1].lock)
> #define OidGenLock (&MainLWLockArray[2].lock)
> #define XidGenLock (&MainLWLockArray[3].lock)
> #define ProcArrayLock (&MainLWLockArray[4].lock)
> #define SInvalReadLock (&MainLWLockArray[5].lock)

... but that doesn't. I challenge you to provide even one example
of that layout in our source tree, or to explain why it's better.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2025-03-02 06:35:12 Re: lwlocknames.h beautification attempt
Previous Message Gurjeet Singh 2025-03-02 06:09:47 lwlocknames.h beautification attempt