Re: pgsql: Provide overflow safe integer math inline functions.

From: Christoph Berg <myon(at)debian(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-committers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
Date: 2017-12-14 08:28:08
Message-ID: 20171214082808.GA5775@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Re: Andres Freund 2017-12-13 <20171213173524(dot)rjs7b3ahsong5zko(at)alap3(dot)anarazel(dot)de>
> On 2017-12-13 09:37:25 -0500, Robert Haas wrote:
> > On Wed, Dec 13, 2017 at 5:10 AM, Christoph Berg <myon(at)debian(dot)org> wrote:
> > > Re: Andres Freund 2017-12-13 <E1eOvQF-00075r-Cy(at)gemulon(dot)postgresql(dot)org>
> > >> Provide overflow safe integer math inline functions.
> > >
> > > The new _overflow functions have buggy comments:
> > >
> > > /*
> > > * If a - b overflows, return true, otherwise store the result of a + b into
> > > * *result. ^ there
> >
> > What's wrong with that?
>
> After staring at it for a while, I seem to have partially mis-copied the
> note for addition to the subtraction operation...

I believe the attached is the correct version.

Christoph

Attachment Content-Type Size
int.h-comments text/plain 2.9 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Teodor Sigaev 2017-12-14 11:30:42 pgsql: Add approximated Zipfian-distributed random generator to pgbench
Previous Message Michael Paquier 2017-12-14 04:05:32 Re: pgsql: Provide overflow safe integer math inline functions.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-12-14 09:12:38 Re: [HACKERS] Parallel Hash take II
Previous Message Michael Paquier 2017-12-14 08:08:44 Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL