| От | Tom Lane |
|---|---|
| Тема | Re: Confusing comment in tidbitmap.c |
| Дата | |
| Msg-id | 20367.1418577086@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Confusing comment in tidbitmap.c (David Rowley <dgrowleyml@gmail.com>) |
| Список | pgsql-hackers |
David Rowley <dgrowleyml@gmail.com> writes:
> The following comment above #define PAGES_PER_CHUNK in tibbitmap.c appears
> to be incorrect:
> "But we
> * also want PAGES_PER_CHUNK to be a power of 2 to avoid expensive integer
> * remainder operations. So, define it like this:"
> I don't quite follow this as it does nothing of the kind.
> Check tbm_page_is_lossy() where we do: bitno = pageno % PAGES_PER_CHUNK;
> Or am I missing something about the compiler optimizing that to: bitno =
> pageno & 255; ?
Exactly. Any C compiler ever written will do that.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера