C11 alignas instead of unions -- extended alignments
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 24 Nov 2025 06:36:49 +0000 (07:36 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 24 Nov 2025 06:39:37 +0000 (07:39 +0100)
commitd4c0f91f7d57066b9d62c0eccb2a913d40c14066
treec2be6f35339f3925f6d01a1f710b4e986f599c23
parent4b203d499c610160e9867e6add2366780429344c
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.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/46f05236-d4d4-4b4e-84d4-faa500f14691%40eisentraut.org
src/include/c.h
src/include/storage/fd.h