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.96) (envelope-from ) id 1vtEJE-00Aqiy-0k for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 00:23:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vtEJC-006CW2-2o for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 00:23:50 +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.96) (envelope-from ) id 1vtEJC-006CVt-1u for pgsql-hackers@lists.postgresql.org; Fri, 20 Feb 2026 00:23:50 +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.98.2) (envelope-from ) id 1vtEJ9-00000000IPl-1h4l for pgsql-hackers@postgresql.org; Fri, 20 Feb 2026 00:23:50 +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 61K0Nim52772967; Thu, 19 Feb 2026 19:23:44 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers , Thomas Munro Subject: Re: Move MAXIMUM_ALIGNOF definition to c.h In-reply-to: <58cedbc7-5658-468d-868e-a4d06de04ca6@eisentraut.org> References: <58cedbc7-5658-468d-868e-a4d06de04ca6@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Tue, 20 Jan 2026 07:48:59 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2772965.1771547024.1@sss.pgh.pa.us> Date: Thu, 19 Feb 2026 19:23:44 -0500 Message-ID: <2772966.1771547024@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut 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