Re: Simplifying our Trap/Assert infrastructure
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-10-09T21:08:39Z
Lists: pgsql-hackers
Nathan Bossart <nathandbossart@gmail.com> 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
Commits
-
Make AssertPointerAlignment available to frontend code
- 2fe4c7384f46 16.0 landed
-
Remove AssertArg and AssertState
- b1099eca8f38 16.0 landed
-
Simplify our Assert infrastructure a little.
- 235eb4db9879 16.0 landed