Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anY3T-0002GG-IL for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2016 20:58:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1anY3T-0005St-4p for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2016 20:58:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1anY3S-0005Sm-Gp for pgsql-hackers@postgresql.org; Tue, 05 Apr 2016 20:58:30 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1anY3O-0002A4-SR for pgsql-hackers@postgresql.org; Tue, 05 Apr 2016 20:58:29 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.83.202.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 1706E400EEF; Tue, 5 Apr 2016 13:58:20 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E6E035CD; Tue, 5 Apr 2016 17:58:17 -0300 (CLT) Date: Tue, 5 Apr 2016 17:58:17 -0300 From: Alvaro Herrera To: Robbie Harwood Cc: Michael Paquier , PostgreSQL mailing lists Subject: Re: [PATCH v12] GSSAPI encryption support Message-ID: <20160405205817.GA366676@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) 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 Robbie Harwood wrote: > Alvaro Herrera writes: > > It seems to me that the right solution for this is to create a new > > memory context which is a direct child of TopMemoryContext, so that > > palloc can be used, and so that it can be reset separately, and that it > > doesn't suffer from resets of other contexts. (I think Michael's point > > is that if those chunks were it a context of their own, you wouldn't > > need the pfrees but a MemCxtReset would be enough.) > > Hmm, that's also an option. I read Michael's point as arguing for > calloc()/free() rather than a new context, but I could be wrong. Yeah, if you weren't using stringinfos that would be an option, but since you are I think that's out of the question. > A question, though: it it valuable for the context to be reset()able > separately? If there were more than just these two buffers going into > it, I could see it being convenient - especially if it were for > different encryption types, for instance - but it seems like it would be > overkill? If two buffers is all, I think retail pfrees are fine. I haven't actually read the patch. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers