From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.
Date: Fri, 17 Feb 2017 11:41:13 -0500
Message-ID: <21143.1487349673@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+Tgmobt7CcF_uQP2UQwWmu4K9qCHehMJP9_9m1urwP8hbOeHQ@mail.gmail.com>
References: <E1ceQOJ-0003cQ-W1@gemulon.postgresql.org>
<CAEepm=1maeY16J2KTwjHvqgs5-5eT3OWYUbE9YqaaE8w5EEtFg@mail.gmail.com>
<CAEepm=0soDK45-O6itxMH2QE+bVp6QvMuxVSnRu51AUxdDivDA@mail.gmail.com>
<CAB7nPqTYsbw07vOEPpocUtNoeq6eACdonhGtHv-cuUiz65X16w@mail.gmail.com>
<CA+Tgmobt7CcF_uQP2UQwWmu4K9qCHehMJP9_9m1urwP8hbOeHQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Robert Haas <robertmhaas@gmail.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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, michael.paquier@gmail.com, thomas.munro@enterprisedb.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.
In-Reply-To: <21143.1487349673@sss.pgh.pa.us>
References: <E1ceQOJ-0003cQ-W1@gemulon.postgresql.org> <CAEepm=1maeY16J2KTwjHvqgs5-5eT3OWYUbE9YqaaE8w5EEtFg@mail.gmail.com> <CAEepm=0soDK45-O6itxMH2QE+bVp6QvMuxVSnRu51AUxdDivDA@mail.gmail.com> <CAB7nPqTYsbw07vOEPpocUtNoeq6eACdonhGtHv-cuUiz65X16w@mail.gmail.com> <CA+Tgmobt7CcF_uQP2UQwWmu4K9qCHehMJP9_9m1urwP8hbOeHQ@mail.gmail.com> <21143.1487349673@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox