Re: Confusing comment in TransactionIdIsInProgress - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Confusing comment in TransactionIdIsInProgress
Date
Msg-id 4D3554A0.5040205@enterprisedb.com
Whole thread Raw
In response to Confusing comment in TransactionIdIsInProgress  (Jim Nasby <jim@nasby.net>)
Responses Re: Confusing comment in TransactionIdIsInProgress
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: limiting hint bit I/O
Next
From: Anssi Kääriäinen
Date:
Subject: Re: REVIEW: Extensions support for pg_dump