Re: pg_verify_checksums and -fno-strict-aliasing

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pg_verify_checksums and -fno-strict-aliasing
Дата
Msg-id 20180830201145.4haw72ldy5r6qzvv@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: pg_verify_checksums and -fno-strict-aliasing  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2018-08-30 10:39:26 -0400, Tom Lane wrote:
>     char        buf[BLCKSZ];
>     PageHeader    header = (PageHeader) buf;

> (The right fix, of course, is to malloc the work buffer rather than
> put it on the stack.)

Or alternatively, for places where such allocations could be a problem
for performance, using a union can be used to force the required
alignment.  I'm fairly certain that just allocating is more than OK
here, to be clear.

Greetings,

Andres Freund


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_verify_checksums and -fno-strict-aliasing
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Use C99 designated initializers for some structs