pgsql: Provide overflow safe integer math inline functions.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Provide overflow safe integer math inline functions.
Дата
Msg-id E1eOvQF-00075r-Cy@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Provide overflow safe integer math inline functions.  (Christoph Berg <myon@debian.org>)
Re: pgsql: Provide overflow safe integer math inline functions.  (Andres Freund <andres@anarazel.de>)
Список pgsql-committers
Provide overflow safe integer math inline functions.

It's not easy to get signed integer overflow checks correct and
fast. Therefore abstract the necessary infrastructure into a common
header providing addition, subtraction and multiplication for 16, 32,
64 bit signed integers.

The new macros aren't yet used, but a followup commit will convert
several open coded overflow checks.

Author: Andres Freund, with some code stolen from Greg Stark
Reviewed-By: Robert Haas
Discussion: https://postgr.es/m/20171024103954.ztmatprlglz3rwke@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4d6ad31257adaf8a51e1c4377d96afa656d9165f

Modified Files
--------------
config/c-compiler.m4          |  22 ++++
configure                     |  33 ++++++
configure.in                  |   4 +
src/include/common/int.h      | 239 ++++++++++++++++++++++++++++++++++++++++++
src/include/pg_config.h.in    |   3 +
src/include/pg_config.h.win32 |   3 +
6 files changed, 304 insertions(+)


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Remove obsolete comment.
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Make PGAC_C_BUILTIN_OP_OVERFLOW link instead of just compiling.