Re: lwlocknames.h beautification attempt - Mailing list pgsql-hackers

From Tom Lane
Subject Re: lwlocknames.h beautification attempt
Date
Msg-id 3128012.1740896767@sss.pgh.pa.us
Whole thread Raw
In response to lwlocknames.h beautification attempt  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: lwlocknames.h beautification attempt
List pgsql-hackers
Gurjeet Singh <gurjeet@singh.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



pgsql-hackers by date:

Previous
From: Gurjeet Singh
Date:
Subject: lwlocknames.h beautification attempt
Next
From: Gurjeet Singh
Date:
Subject: Re: lwlocknames.h beautification attempt