move some bitmapset.c macros to bitmapset.h

Поиск
Список
Период
Сортировка
От John Naylor
Тема move some bitmapset.c macros to bitmapset.h
Дата
Msg-id CAFBsxsFW2JjTo58jtDB+3sZhxMx3t-3evew8=Acr+GGhC+kFaA@mail.gmail.com
обсуждение исходный текст
Ответы Re: move some bitmapset.c macros to bitmapset.h  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Over in [1], Masahiko and I found that using some bitmapset logic yields a useful speedup in one part of the proposed radix tree patch. In addition to what's in bitmapset.h now, we'd need WORDNUM, BITNUM, RIGHTMOST_ONE and bmw_rightmost_one_pos() from bitmapset.c. The file tidbitmap.c has its own copies of the first two, and we could adapt that strategy again. But instead of three files defining these, it seems like it's time to consider moving them somewhere more central.

Attached is a simple form of this concept, including moving HAS_MULTIPLE_ONES just for consistency. One possible objection is the possibility of namespace clash. Thoughts?

I also considered putting the macros and typedefs in pg_bitutils.h. One organizational advantage is that pg_bitutils.h already offers convenience function symbols where the parameter depends on SIZEOF_SIZE_T, so putting the BITS_PER_BITMAPWORD versions there makes sense. But that way is not a clear win, so I didn't go that far.

[1] https://www.postgresql.org/message-id/CAFBsxsHgP5LP9q%3DRq_3Q2S6Oyut67z%2BVpemux%2BKseSPXhJF7sg%40mail.gmail.com

--
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Borisov
Дата:
Сообщение: Re: Allow placeholders in ALTER ROLE w/o superuser
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: move some bitmapset.c macros to bitmapset.h