Re: [CFReview] Red-Black Tree

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: [CFReview] Red-Black Tree
Дата
Msg-id 4B72FD90.10404@sigaev.ru
обсуждение исходный текст
Ответ на Re: [CFReview] Red-Black Tree  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [CFReview] Red-Black Tree  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: [CFReview] Red-Black Tree  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
> So suppose at this point that step is the largest integer that can be
> represented...
>> !       step ++;
> Boom.
>> !       step>>= 1;
step>>= 1;
step ++'

Unboom?


>> !
>> !       while(step>  0) {
>> !               int i;
>>
>> !               for (i = step-1; i<  nentry; i += 2 * step)
>
> And similarly here... if nentry is greater than maxint/2, then i += 2
> * step will overflow, no?

Agree, so
for (i = step - 1; i < nentry && i >= 0; i += step << 1 /* *2 */)


Also, rb_free is removed per Tom's comment. Can I commit  the patch?
--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

Вложения

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

Предыдущее
От: Leonardo F
Дата:
Сообщение: Re: I: About "Our CLUSTER implementation is pessimal" patch
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [CFReview] Red-Black Tree