Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7F6071337B63 for ; Tue, 18 Jan 2011 04:51:56 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 98720-03 for ; Tue, 18 Jan 2011 08:51:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mail.postgresql.org (Postfix) with SMTP id 610B21337B54 for ; Tue, 18 Jan 2011 04:51:47 -0400 (AST) Received: from source ([209.85.161.48]) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKTTVUo/tYiOCkWtQ056xMqkOFRSM0MDPC@postini.com; Tue, 18 Jan 2011 00:51:49 PST Received: by mail-fx0-f48.google.com with SMTP id 2so7783417fxm.7 for ; Tue, 18 Jan 2011 00:51:47 -0800 (PST) Received: by 10.223.101.199 with SMTP id d7mr5846867fao.149.1295340706982; Tue, 18 Jan 2011 00:51:46 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id l14sm1976876fan.33.2011.01.18.00.51.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 18 Jan 2011 00:51:46 -0800 (PST) Message-ID: <4D3554A0.5040205@enterprisedb.com> Date: Tue, 18 Jan 2011 10:51:44 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Jim Nasby CC: pgsql-hackers Hackers Subject: Re: Confusing comment in TransactionIdIsInProgress References: <60BA971A-52A4-4A11-9AA1-0839BB6F15A3@nasby.net> In-Reply-To: <60BA971A-52A4-4A11-9AA1-0839BB6F15A3@nasby.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201101/1621 X-Sequence-Number: 179458 On 18.01.2011 07:15, Jim Nasby wrote: > Shouldn't the comment read "If first time through"? > > /* > * If not first time through, get workspace to remember main XIDs in. We > * malloc it permanently to avoid repeated palloc/pfree overhead. > */ > if (xids == NULL) > { > ... > xids = (TransactionId *) malloc(maxxids * sizeof(TransactionId)); Huh, yes, I'm amazed that no-one have noticed. I must've read that piece of code dozens of times in the last couple of years myself, and that sentence was even copy-pasted to GetConflictingVirtualXIDs() later in that file, including that thinko. Thanks, fixed both copies. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com