Re: move some bitmapset.c macros to bitmapset.h - Mailing list pgsql-hackers

From Tom Lane
Subject Re: move some bitmapset.c macros to bitmapset.h
Date
Msg-id 3555640.1670306251@sss.pgh.pa.us
Whole thread Raw
In response to Re: move some bitmapset.c macros to bitmapset.h  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: move some bitmapset.c macros to bitmapset.h
List 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



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: move some bitmapset.c macros to bitmapset.h
Next
From: John Naylor
Date:
Subject: Re: move some bitmapset.c macros to bitmapset.h