pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Jim Nasby <jim@nasby.net>
Cc: pgsql-hackers Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Confusing comment in TransactionIdIsInProgress
Date: Tue, 18 Jan 2011 10:51:44 +0200
Message-ID: <4D3554A0.5040205@enterprisedb.com> (raw)
In-Reply-To: <60BA971A-52A4-4A11-9AA1-0839BB6F15A3@nasby.net>
References: <60BA971A-52A4-4A11-9AA1-0839BB6F15A3@nasby.net>

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



view thread (3+ messages)  latest in thread

Message-ID: <4D3554A0.5040205@enterprisedb.com>
Permalink:  ../4D3554A0.5040205@enterprisedb.com/
Also on:    postgresql.org/message-id/4D3554A0.5040205@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, jim@nasby.net
  Subject: Re: Confusing comment in TransactionIdIsInProgress
  In-Reply-To: <4D3554A0.5040205@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox