Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to
Date: 2010-01-28 15:46:07
Message-ID: 1264693567.24669.10769.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, 2010-01-28 at 10:43 -0500, Tom Lane wrote:
> sriggs(at)postgresql(dot)org (Simon Riggs) writes:
> > Log Message:
> > -----------
> > Use malloc() in GetLockConflicts() when called InHotStandby to avoid repeated
> > palloc calls. Current code assumed this was already true, so this is a bug fix.
>
> It seems pretty ugly to allocate the same pointer sometimes with malloc
> and sometimes with palloc. How about palloc'ing it in TopMemoryContext
> when you want it to be persistent?

Yes, that sounds more graceful. Will do.

--
Simon Riggs www.2ndQuadrant.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-01-28 15:46:47 Re: pgsql: Define INADDR_NONE on Solaris when it's missing.
Previous Message Tom Lane 2010-01-28 15:43:27 Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to