Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tocmE-00DFa1-Qu for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Mar 2025 06:26:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tocmF-00G7KX-Ia for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Mar 2025 06:26:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tocmF-00G7JI-8Z for pgsql-hackers@lists.postgresql.org; Sun, 02 Mar 2025 06:26:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tocm7-000U5B-3B for pgsql-hackers@postgresql.org; Sun, 02 Mar 2025 06:26:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5226Q7Fl3128013; Sun, 2 Mar 2025 01:26:07 -0500 From: Tom Lane To: Gurjeet Singh cc: Postgres Hackers Subject: Re: lwlocknames.h beautification attempt In-reply-to: References: Comments: In-reply-to Gurjeet Singh message dated "Sat, 01 Mar 2025 22:09:47 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3128011.1740896767.1@sss.pgh.pa.us> Date: Sun, 02 Mar 2025 01:26:07 -0500 Message-ID: <3128012.1740896767@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Gurjeet Singh 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