From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Provide overflow safe integer math inline functions.
Date: Wed, 13 Dec 2017 01:01:19 +0000
Message-ID: <E1eOvQF-00075r-Cy@gemulon.postgresql.org> (raw)
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(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
In-Reply-To: <E1eOvQF-00075r-Cy@gemulon.postgresql.org>
References: <E1eOvQF-00075r-Cy@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox