Re: [HACKERS] Small code improvement for btree

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Re: [HACKERS] Small code improvement for btree
Дата
Msg-id CAD21AoCrnaPN0DqW5D3XmrujGWc1Peieeb6HHAO0c_ZuNX-Q5Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Small code improvement for btree  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: [HACKERS] Small code improvement for btree  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-hackers
On Sat, Aug 5, 2017 at 3:29 AM, Peter Geoghegan <pg@bowt.ie> wrote:
> On Fri, Aug 4, 2017 at 11:12 AM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> Interesting.  We learned elsewhere that it's better to integrate the
>> "!= 0" test as part of the macro definition; so a
>> better formulation of this patch would be to change the
>> P_INCOMPLETE_SPLIT macro and omit the comparison in the Assert.  (See
>> commit 594e61a1de03 for an example).

Thank you for the information. The macros other than
P_INCOMPLETE_SPLIT in btree.h such as P_ISLEAF, P_ISROOT also doesn't
return booleans. Should we deal with them as well?

>>
>>
>>> -               LockBuffer(hbuffer, BUFFER_LOCK_SHARE);
>>> +               LockBuffer(hbuffer, BT_READ);
>
> +1.
>
> One Linus Torvalds rant that I actually agreed with was a rant against
> the use of bool as a type in C code. It's fine, as long as you never
> forget that it's actually just another integer.
>
>> I think BT_READ and BT_WRITE are useless, and I'd rather get rid of
>> them ...
>
> Fair enough, but we should either use them consistently or not at all.
> I'm not especially concerned about which, as long as it's one of those
> two.
>

I definitely agreed.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Subscription code improvements
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] [TRAP: FailedAssertion] causing server to crash