Re: Simplifying our Trap/Assert infrastructure

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-10-09T21:29:37Z
Lists: pgsql-hackers
On Sun, Oct 09, 2022 at 05:08:39PM -0400, Tom Lane wrote:
> 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.

I don't see why not.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



Commits

  1. Make AssertPointerAlignment available to frontend code

  2. Remove AssertArg and AssertState

  3. Simplify our Assert infrastructure a little.