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

From: Alexander Kuleshov <kuleshovmail(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Use MemoryContextAlloc() in the MemoryContextAllocZero() and MemoryContextAllocZeroAligned()
Date: 2016-03-12 07:09:54
Message-ID: CANCZXo5+rDtcoghEs=0_Qoxis7cB6jh7MwhLZm2_DwpEaE6Opw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
mm-context-simplify-alloc.patch text/x-patch 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Salvador Fandiño 2016-03-12 07:22:30 Re: Perl's newSViv() versus 64-bit ints?
Previous Message Amit Kapila 2016-03-12 06:58:56 Re: Explain [Analyze] produces parallel scan for select Into table statements.