]> granicus.if.org Git - postgresql/commit
Use new overflow aware integer operations.
authorAndres Freund <andres@anarazel.de>
Wed, 13 Dec 2017 00:32:31 +0000 (16:32 -0800)
committerAndres Freund <andres@anarazel.de>
Wed, 13 Dec 2017 00:55:37 +0000 (16:55 -0800)
commit101c7ee3ee847bac970c74b73b4f2858484383e5
tree0e2c14000aa86975fbb36fb36470f54251b83b54
parent4d6ad31257adaf8a51e1c4377d96afa656d9165f
Use new overflow aware integer operations.

A previous commit added inline functions that provide fast(er) and
correct overflow checks for signed integer math. Use them in a
significant portion of backend code.  There's more to touch in both
backend and frontend code, but these were the easily identifiable
cases.

The old overflow checks are noticeable in integer heavy workloads.

A secondary benefit is that getting rid of overflow checks that rely
on signed integer overflow wrapping around, will allow us to get rid
of -fwrapv in the future. Which in turn slows down other code.

Author: Andres Freund
Discussion: https://postgr.es/m/20171024103954.ztmatprlglz3rwke@alap3.anarazel.de
14 files changed:
contrib/btree_gist/btree_cash.c
contrib/btree_gist/btree_int2.c
contrib/btree_gist/btree_int4.c
contrib/btree_gist/btree_int8.c
contrib/btree_gist/btree_utils_num.h
src/backend/utils/adt/array_userfuncs.c
src/backend/utils/adt/cash.c
src/backend/utils/adt/float.c
src/backend/utils/adt/int.c
src/backend/utils/adt/int8.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/oracle_compat.c
src/backend/utils/adt/varbit.c
src/backend/utils/adt/varlena.c