Re: move some bitmapset.c macros to bitmapset.h
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: John Naylor <john.naylor@enterprisedb.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-06T05:57:31Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes: > Maybe there's a path of lesser resistance... There's been a bit of > work in pg_bitutils.h to define some of the bit manipulation functions > for size_t types which wrap the 32 or 64-bit version of the function > accordingly. Couldn't we just define one of those for > pg_rightmost_one_pos and then use a size_t as the bitmap word type? It doesn't seem particularly wise to me to hard-wire the bitmap word size as sizeof(size_t). There is not a necessary connection between those things: there could be a performance reason to choose a word width that's different from size_t. If we do put RIGHTMOST_ONE functionality into pg_bitutils.h, I'd envision it as pg_bitutils.h exporting both 32-bit and 64-bit versions of that, and then bitmapset.c choosing the appropriate one just like it chooses bmw_rightmost_one_pos. regards, tom lane
Commits
-
Move some bitmap logic out of bitmapset.c
- 3e76a806cbb0 17.0 landed