Re: Speedup usages of pg_*toa() functions

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Speedup usages of pg_*toa() functions
Date: 2020-06-10 07:25:03
Message-ID: 87v9jz5qsl.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Ranier" == Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:

Ranier> Sorry, my mistake.

Ranier> uvalue = (uint64) 0 - value;

This doesn't gain anything over the original, and it has the downside of
hiding an int64 to uint64 conversion that is actually quite sensitive.
For example, it might tempt someone to rewrite it as

uvalue = -value;

which is actually incorrect (though our -fwrapv will hide the error).

--
Andrew (irc:RhodiumToad)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-06-10 08:25:18 Re: Terminate the idle sessions
Previous Message Masahiko Sawada 2020-06-10 07:00:45 Re: Resetting spilled txn statistics in pg_stat_replication