Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfDTs-0002JA-91 for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Feb 2017 22:27:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cfDTr-0003uS-D3 for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Feb 2017 22:27:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cfDTp-0003st-Ah for pgsql-hackers@postgresql.org; Sat, 18 Feb 2017 22:27:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cfDTl-0000mj-Hp for pgsql-hackers@postgresql.org; Sat, 18 Feb 2017 22:27:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v1IMRgn5028063; Sat, 18 Feb 2017 17:27:42 -0500 From: Tom Lane To: Thomas Munro cc: Robert Haas , Michael Paquier , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0. In-reply-to: References: <21143.1487349673@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Sun, 19 Feb 2017 10:06:41 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28061.1487456862.1@sss.pgh.pa.us> Date: Sat, 18 Feb 2017 17:27:42 -0500 Message-ID: <28062.1487456862@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Thomas Munro writes: > On Sat, Feb 18, 2017 at 5:41 AM, Tom Lane wrote: >> Robert Haas 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