Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1celcN-0000eR-C2 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Feb 2017 16:42:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1celcM-00060Y-VM for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Feb 2017 16:42:47 +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 1celaw-00034U-9K for pgsql-hackers@postgresql.org; Fri, 17 Feb 2017 16:41:18 +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 1celat-0007jD-N2 for pgsql-hackers@postgresql.org; Fri, 17 Feb 2017 16:41:17 +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 v1HGfDGv021144; Fri, 17 Feb 2017 11:41:13 -0500 From: Tom Lane To: Robert Haas cc: Michael Paquier , Thomas Munro , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add new function dsa_allocate0. In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Fri, 17 Feb 2017 08:17:17 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21142.1487349673.1@sss.pgh.pa.us> Date: Fri, 17 Feb 2017 11:41:13 -0500 Message-ID: <21143.1487349673@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 Robert Haas 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