Re: pgsql: Add new function dsa_allocate0.

Thomas Munro <thomas.munro@enterprisedb.com>

From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Robert Haas <rhaas@postgresql.org>
Cc: pgsql-committers@postgresql.org
Date: 2017-02-16T22:34:45Z
Lists: pgsql-hackers
On Fri, Feb 17, 2017 at 7:02 AM, Robert Haas <rhaas@postgresql.org> wrote:
> Add new function dsa_allocate0.
>
> This does the same thing as dsa_allocate, except that the memory
> is guaranteed to be zero-filled on return.
>
> Dilip Kumar, adjusted by me.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/9acb85597f1223ac26a5b19a9345849c43d0ff54
>
> Modified Files
> --------------
> src/backend/utils/mmgr/dsa.c | 16 ++++++++++++++++
> src/include/utils/dsa.h      |  1 +
> 2 files changed, 17 insertions(+)

Hmm.  This will segfault if you're out of memory.

-- 
Thomas Munro
http://www.enterprisedb.com


Commits

  1. Make dsa_allocate interface more like MemoryContextAlloc.

  2. Add new function dsa_allocate0.