pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.
Date: Sat, 18 Feb 2017 17:27:42 -0500
Message-ID: <28062.1487456862@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEepm=1OC3uphzWoY4vTDO07TF3W3ms0VgxbtEZ0vq5_LEFM8w@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>
	<21143.1487349673@sss.pgh.pa.us>
	<CAEepm=1OC3uphzWoY4vTDO07TF3W3ms0VgxbtEZ0vq5_LEFM8w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Thomas Munro <thomas.munro@enterprisedb.com> writes:
> On Sat, Feb 18, 2017 at 5:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> I'm thinking we should change this to look more like the
>>> MemoryContextAlloc interface.

>> +1

> Maybe something like the attached?  I didn't add DSA_ALLOC_HUGE
> because there is currently no limit on allocation size (other than the
> limit on total size which you can set with dsa_set_size_limit, but
> that causes allocation failure, not a separate kind of error).  Should
> there be a per-allocation size sanity check of 1GB like palloc?

I think it's not a bad idea.  It could help catch faulty allocation
requests (since I'd bet very few call sites actually intend to allocate
gigabytes in one go), and as Robert says, there is substantial value in
the semantics being as much like palloc() as possible.  People are
likely to assume that even if it isn't true.

			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



view thread (11+ messages)  latest in thread

Message-ID: <28062.1487456862@sss.pgh.pa.us>
Permalink:  ../28062.1487456862@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28062.1487456862@sss.pgh.pa.us

 · 

reply

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, thomas.munro@enterprisedb.com, robertmhaas@gmail.com, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.
  In-Reply-To: <28062.1487456862@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> <CAEepm=1OC3uphzWoY4vTDO07TF3W3ms0VgxbtEZ0vq5_LEFM8w@mail.gmail.com> <28062.1487456862@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