Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.
Date: 2017-02-17 16:41:13
Message-ID: 21143.1487349673@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> I'm thinking we should change this to look more like the
> MemoryContextAlloc interface. Let's have DSA_ALLOC_HUGE,
> DSA_ALLOC_NO_OOM, and DSA_ALLOC_ZERO, just like the corresponding
> MCXT_* flags, and a function dsa_allocate_extended() that takes a
> flags argument. Then, dsa_allocate(x,y) can be a macro for
> dsa_allocate_extended(x,y,0) and dsa_allocate0(x,y) can be a macro for
> dsa_allocate_extended(x,y,DSA_ALLOC_ZERO). What this goof on my (and
> Dilip's) part illustrates to me is that having this interface behave
> significantly differently from the MemoryContextAlloc interface is
> going to cause mistakes.

+1

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-02-17 20:14:33 pgsql: pg_dump: Fix typo in query
Previous Message Peter Eisentraut 2017-02-17 13:57:58 pgsql: Remove redundant coverage target

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-02-17 17:17:35 Re: Index corruption with CREATE INDEX CONCURRENTLY
Previous Message Alvaro Herrera 2017-02-17 16:39:49 Re: Index corruption with CREATE INDEX CONCURRENTLY