Commit c90c165
committed
Fix some incorrect preprocessor tests in tuplesort specializations
6974924 added 3 new quicksort specialization functions for common
datatypes.
That commit was not very consistent in how it would determine if we're
compiling for 32-bit or 64-bit machines. It would sometimes use
USE_FLOAT8_BYVAL and at other times check if SIZEOF_DATUM == 8. This
could cause theoretical problems due to the way USE_FLOAT8_BYVAL is now
defined based on SIZEOF_VOID_P >= 8. If pointers for some reason were
ever larger than 8-bytes then we'd end up doing 32-bit comparisons
mistakenly. Let's just always check SIZEOF_DATUM >= 8.
It also seems that ssup_datum_signed_cmp is just never used on 32-bit
builds, so let's just ifdef that out to make sure we never accidentally
use that comparison function on such machines. This also allows us to
ifdef out 1 of the 3 new specialization quicksort functions in 32-bit
builds which seems to shrink down the binary by over 4KB on my machine.
In passing, also add the missing DatumGetInt32() / DatumGetInt64() macros
in the comparison functions.
Discussion: https://postgr.es/m/CAApHDvqcQExRhtRa9hJrJB_5egs3SUfOcutP3m+3HO8A+fZTPA@mail.gmail.com
Reviewed-by: John Naylor1 parent aff45c8 commit c90c165
File tree
4 files changed
+18
-13
lines changed- src
- backend
- access/nbtree
- utils
- adt
- sort
- include/utils
4 files changed
+18
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2176 | 2176 | | |
2177 | 2177 | | |
2178 | 2178 | | |
2179 | | - | |
| 2179 | + | |
2180 | 2180 | | |
2181 | 2181 | | |
2182 | 2182 | | |
| |||
2193 | 2193 | | |
2194 | 2194 | | |
2195 | 2195 | | |
2196 | | - | |
| 2196 | + | |
2197 | 2197 | | |
2198 | 2198 | | |
2199 | 2199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
| |||
737 | 738 | | |
738 | 739 | | |
739 | 740 | | |
| 741 | + | |
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
| |||
779 | 781 | | |
780 | 782 | | |
781 | 783 | | |
| 784 | + | |
782 | 785 | | |
783 | 786 | | |
784 | 787 | | |
| |||
787 | 790 | | |
788 | 791 | | |
789 | 792 | | |
| 793 | + | |
790 | 794 | | |
791 | 795 | | |
792 | 796 | | |
| |||
3666 | 3670 | | |
3667 | 3671 | | |
3668 | 3672 | | |
| 3673 | + | |
3669 | 3674 | | |
3670 | 3675 | | |
3671 | 3676 | | |
| |||
3674 | 3679 | | |
3675 | 3680 | | |
3676 | 3681 | | |
| 3682 | + | |
3677 | 3683 | | |
3678 | 3684 | | |
3679 | 3685 | | |
| |||
4905 | 4911 | | |
4906 | 4912 | | |
4907 | 4913 | | |
| 4914 | + | |
4908 | 4915 | | |
4909 | 4916 | | |
4910 | 4917 | | |
4911 | | - | |
4912 | | - | |
4913 | | - | |
4914 | | - | |
4915 | | - | |
4916 | | - | |
4917 | | - | |
| 4918 | + | |
| 4919 | + | |
4918 | 4920 | | |
4919 | 4921 | | |
4920 | 4922 | | |
| |||
4923 | 4925 | | |
4924 | 4926 | | |
4925 | 4927 | | |
| 4928 | + | |
4926 | 4929 | | |
4927 | 4930 | | |
4928 | 4931 | | |
4929 | 4932 | | |
4930 | | - | |
4931 | | - | |
| 4933 | + | |
| 4934 | + | |
4932 | 4935 | | |
4933 | 4936 | | |
4934 | 4937 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
382 | 383 | | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| |||
0 commit comments