Re: Use C11 alignas instead of palloc/malloc for alignment

From: Rui Zhao <zhaorui126(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Use C11 alignas instead of palloc/malloc for alignment
Date: 2026-10-28 03:11:07
Message-ID: CAHWVJhFtf4s--=pehK8Fa=G7a3xwKZi4gVi7WnF+AwwfKPyvQg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Peter,

Thanks very much for replacing allocations that were only needed for
alignment. I reviewed v4 and did not find any substantive issues.

I checked the alignment, and it is fine:
on x86-64 Linux, I get MAXIMUM_ALIGNOF = 8 and alignof(max_align_t) = 16.
However, alignof(ControlFileData) is also 8,
so MAXIMUM_ALIGNOF is sufficient for the buffer in pg_resetwal's
read_controlfile().

The core regression suite and the pg_resetwal and pg_waldump tests passed.

Regards,
Rui

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-10-28 03:13:37 Re: Any reason to keep HEAP_HASOID_OLD?
Previous Message Ashutosh Bapat 2026-10-28 02:50:09 Re: [PATCH] regression test: view and rule definitions must round trip