Re: Move MAXIMUM_ALIGNOF definition to c.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Move MAXIMUM_ALIGNOF definition to c.h
Date: 2026-02-20 00:23:44
Message-ID: 2772966.1771547024@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> As suggested at [0], we can move the computation of MAXIMUM_ALIGNOF from
> configure.ac and meson.build to c.h. This eliminates code duplication.
> (For example, the AIX patch contemplates some changes, so it would be
> good to make those in only one place.)

I looked at this but am pretty underwhelmed. Yes, it replaces two
copies of that logic with one, but said logic is so trivial that
that's not a big win. Moreover, I'm finding it hard to believe
that we'll ever need to change that logic again --- the plain
max-of-two-alignment-measurements logic is the way it had been
for a long time and will be again after the AIX patch lands. I can't
foresee a future platform where it'd need to be any different.

In exchange for that simplification, we are taking a computation
that currently is done once per configure/meson-setup step, and
instead computing it during each .c file build. I imagine that
at least the autoconf implementation is more expensive than
what the C compiler would need to do, but repeating it over and
over again will surely end up costing more.

So this doesn't seem like a good change to me.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-02-20 00:28:56 Re: Skipping schema changes in publication
Previous Message Robert Haas 2026-02-20 00:16:45 call for applications: hacker mentoring 2026