Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohdXS-0006xK-99 for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Oct 2022 21:08:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ohdXR-0005xl-5y for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Oct 2022 21:08:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohdXQ-0005xO-TK for pgsql-hackers@lists.postgresql.org; Sun, 09 Oct 2022 21:08:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohdXO-00026S-9M for pgsql-hackers@lists.postgresql.org; Sun, 09 Oct 2022 21:08:44 +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 299L8d9k3943010; Sun, 9 Oct 2022 17:08:39 -0400 From: Tom Lane To: Nathan Bossart cc: pgsql-hackers@lists.postgresql.org Subject: Re: Simplifying our Trap/Assert infrastructure In-reply-to: <20221009210148.GA900071@nathanxps13> References: <3928703.1665345117@sss.pgh.pa.us> <20221009210148.GA900071@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Sun, 09 Oct 2022 14:01:48 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3943008.1665349719.1@sss.pgh.pa.us> Date: Sun, 09 Oct 2022 17:08:39 -0400 Message-ID: <3943009.1665349719@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Sun, Oct 09, 2022 at 03:51:57PM -0400, Tom Lane wrote: >> Hence, I propose the attached. > The patch LGTM. It might be worth removing usages of AssertArg and > AssertState, too, but that can always be done separately. Something I thought about but forgot to mention in the initial email: is it worth sprinkling these macros with "unlikely()"? I think that compilers might assume the right thing automatically based on noticing that ExceptionalCondition is noreturn ... but then again they might not. Of course we're not that fussed about micro-optimizations in assert-enabled builds; but with so many Asserts in the system, it might still add up to something noticeable if there is an effect. regards, tom lane