pgsql: Further improve code for probing the availability of ARM CRCins

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Further improve code for probing the availability of ARM CRCins
Дата
Msg-id E1fEGEA-0001Is-Vl@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Further improve code for probing the availability of ARM CRC instructions.

Andrew Gierth pointed out that commit 1c72ec6f4 would yield the wrong
answer on big-endian ARM systems, because the data being CRC'd would be
different.  To fix that, and avoid the rather unsightly hard-wired
constant, simply compare the hardware and software implementations'
results.

While we're at it, also log the resulting decision at DEBUG1, and error
out if the hw and sw results unexpectedly differ.  Also, since this
file must compile for both frontend and backend, avoid incorrect
dependencies on backend-only headers.

In passing, add a comment to postmaster.c about when the CRC function
pointer will get initialized.

Thomas Munro, based on complaints from Andrew Gierth and Tom Lane

Discussion: https://postgr.es/m/HE1PR0801MB1323D171938EABC04FFE7FA9E3110@HE1PR0801MB1323.eurprd08.prod.outlook.com

Branch
------
master

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

Modified Files
--------------
src/backend/postmaster/postmaster.c | 10 +++++++++-
src/port/pg_crc32c_armv8_choose.c   | 37 ++++++++++++++++++++++++++++++-------
2 files changed, 39 insertions(+), 8 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Fix SPI error cleanup and memory leak
Следующее
От: Teodor Sigaev
Дата:
Сообщение: pgsql: Fix pg_dump support for pre-8.2 versions