Re: Avoid incorrect allocation in buildIndexArray

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Avoid incorrect allocation in buildIndexArray
Дата
Msg-id CAOBaU_biM4rV7cdYVZkY5T3D9hXQWV5Gyiz9uecszLLo7CpqTA@mail.gmail.com
обсуждение исходный текст
Ответ на Avoid incorrect allocation in buildIndexArray  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: Avoid incorrect allocation in buildIndexArray
Список pgsql-hackers
On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson <daniel@yesql.se> wrote:
>
> Looking at a pg_dump patch I realized that when we call buildIndexArray without
> having found objects to index, we still call pg_malloc with zero which in turn
> mallocs 1 byte.  The byte in question is of course negligable, but it does seem
> cleaner to return early with NULL instead of returning an empty allocation
> which doesn't actually contain an index.
>
> Any reason not to bail early as per the attached?

+1



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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Avoid incorrect allocation in buildIndexArray
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Avoid incorrect allocation in buildIndexArray