Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anVxJ-0004sw-Nr for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2016 18:44:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1anVxJ-0007Aj-5P for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2016 18:44:01 +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 1anVxI-00079n-05 for pgsql-hackers@postgresql.org; Tue, 05 Apr 2016 18:44:00 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1anVxD-0002fh-4i for pgsql-hackers@postgresql.org; Tue, 05 Apr 2016 18:43:59 +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 194FD400DA9; Tue, 5 Apr 2016 11:43:48 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 135B35CD; Tue, 5 Apr 2016 15:43:46 -0300 (CLT) Date: Tue, 5 Apr 2016 15:43:46 -0300 From: Alvaro Herrera To: Robbie Harwood Cc: Michael Paquier , PostgreSQL mailing lists , Magnus Hagander Subject: Re: [PATCH v12] GSSAPI encryption support Message-ID: <20160405184346.GA317471@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: > Michael Paquier writes: > > > On Tue, Apr 5, 2016 at 9:06 AM, Robbie Harwood wrote: > >> Here's v12, both here and on my github: > >> https://github.com/frozencemetery/postgres/tree/feature/gssencrypt12 > > So you are saving everything in the top memory context. I am fine to > > give the last word to a committer here but I would just go with > > calloc/free to simplify those hunks. > > Yeah, it's definitely worth thinking/talking about; this came up in IRC > discussion as well. > > If we go the memory context route, it has to be TopMemoryContext since > nothing else lives long enough (i.e., entire connection). [...] > It turns out that's not actually required, but could easily be made > explicit here. According to the README for the memory context system, > pfree() and repalloc() do not require setting CurrentMemoryContext > (since 7.1). 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.) > Side note: it's really irritating to work with having this file under > version control because of how different it ends up being when I > autoreconf (which I need to do because I'm changing the build system). > (I'm also idly curious what system/autotools version is generating this > file because it doesn't match any that I tried.) We use stock autoconf from the GNU package and it definitely produces matching output for me. Maybe your Linux distro includes a patched version? I know Debian does, but I suppose you're using some Redhat thing, so no idea. -- Á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