Re: [PATCH] Use MemoryContextAlloc() in the MemoryContextAllocZero() and MemoryContextAllocZeroAligned()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Use MemoryContextAlloc() in the MemoryContextAllocZero() and MemoryContextAllocZeroAligned()
Дата
Msg-id CAB7nPqT=6EFKbnu5GuJFiH2qS1KUhTSeVUrJovKF7unoD4i6Wg@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Use MemoryContextAlloc() in the MemoryContextAllocZero() and MemoryContextAllocZeroAligned()  (Alexander Kuleshov <kuleshovmail@gmail.com>)
Список pgsql-hackers
On Sat, Mar 12, 2016 at 8:09 AM, Alexander Kuleshov
<kuleshovmail@gmail.com> wrote:
> Hello all,
>
> Attached patch simplifies the MemoryContextAllocZero() and
> MemoryContextAllocZeroAligned().
> The MemoryContextAllocZero() and MemoryContextAllocZeroAligned()
> functions does almost the
> same that MemoryContextAlloc() does. Additionally these functions
> fills allocated memory context
> with zeros via MemSetAligned() and MemSetLoop(). Let's call
> MemoryContextAlloc() in these functions
> instead of setting isReset to false, call alloc() callback of the
> context and etc., to prevent code duplication.

This code duplication is on purpose. This is a very hot code path and
we want to avoid the overhead of an extra function call.
-- 
Michael



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

Предыдущее
От: Mithun Cy
Дата:
Сообщение: Re: Explain [Analyze] produces parallel scan for select Into table statements.
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Explain [Analyze] produces parallel scan for select Into table statements.