• Andres Freund's avatar
    Use new overflow aware integer operations. · 101c7ee3
    Andres Freund authored
    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
    101c7ee3
btree_utils_num.h 3.94 KB