postgresql/src/backend/utils
Tom Lane 0ce38730ac Micro-optimize AllocSetFreeIndex() by reference to pg_bitutils code.
Use __builtin_clz() where available.  Where it isn't, we can still win
a little by using the pg_leftmost_one_pos[] lookup table instead of
having a private table.

Also drop the initial right shift by ALLOC_MINBITS in favor of
subtracting ALLOC_MINBITS from the leftmost-one-pos result.  This
is a win because the compiler can fold that adjustment into other
constants it'd have to add anyway, making the shift-removal free.

Also, we can explain this coding as an unrolled form of
pg_leftmost_one_pos32(), even though that's a bit ahistorical
since it long predates pg_bitutils.h.

John Naylor, with some cosmetic adjustments by me

Discussion: https://postgr.es/m/CACPNZCuNUGMxjK7WTn_=WZnRbfASDdBxmjsVf2+m9MdmeNw_sg@mail.gmail.com
2019-12-28 17:21:17 -05:00
..
adt Revert "Rename files and headers related to index AM" 2019-12-27 08:09:00 +09:00
cache Revert "Rename files and headers related to index AM" 2019-12-27 08:09:00 +09:00
error Remove debugging aid 2019-11-23 13:19:20 -03:00
fmgr Remove configure --disable-float4-byval 2019-11-21 18:29:21 +01:00
hash Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
init Revert "Rename files and headers related to index AM" 2019-12-27 08:09:00 +09:00
mb Add backend-only appendStringInfoStringQuoted 2019-12-10 17:12:56 -03:00
misc Avoid splitting C string literals with \-newline 2019-12-24 12:44:12 -03:00
mmgr Micro-optimize AllocSetFreeIndex() by reference to pg_bitutils code. 2019-12-28 17:21:17 -05:00
resowner Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
sort Remove unused code from tuplesort. 2019-11-13 15:57:01 -08:00
time Make the order of the header file includes consistent in backend modules. 2019-11-12 08:30:16 +05:30
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
errcodes.txt Implement jsonpath .datetime() method 2019-09-25 22:51:51 +03:00
Gen_dummy_probes.pl Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
Gen_dummy_probes.sed Update copyright for 2019 2019-01-02 12:44:25 -05:00
Gen_fmgrtab.pl Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
generate-errcodes.pl Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Use Getopt::Long for catalog scripts 2019-02-12 12:22:08 -03:00
probes.d Sync our DTrace infrastructure with c.h's definition of type bool. 2019-11-06 11:11:40 -05:00