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

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

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?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2010-01-28 15:46:07 Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to
Previous Message Magnus Hagander 2010-01-28 14:25:43 pgsql: Add functions to reset the statistics counter for a single