pgsql: C11 alignas instead of unions -- extended alignments

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: C11 alignas instead of unions -- extended alignments
Date: 2025-11-24 06:54:37
Message-ID: E1vNQT7-0017ey-17@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

C11 alignas instead of unions -- extended alignments

This replaces some uses of pg_attribute_aligned() with the standard
alignas() for cases where extended alignment (larger than max_align_t)
is required.

This patch stipulates that all supported compilers must support
alignments up to PG_IO_ALIGN_SIZE, but that seems pretty likely.

We can then also desupport the case where direct I/O is disabled
because pg_attribute_aligned is not supported.

Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/46f05236-d4d4-4b4e-84d4-faa500f14691%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d4c0f91f7d57066b9d62c0eccb2a913d40c14066

Modified Files
--------------
src/include/c.h | 18 ++++--------------
src/include/storage/fd.h | 5 ++---
2 files changed, 6 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-11-24 10:34:48 pgsql: Move isolation test index-killtuples to src/test/modules/index/
Previous Message Michael Paquier 2025-11-24 05:29:33 pgsql: pg_buffercache: Add pg_buffercache_os_pages