Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to
Date
Msg-id 15185.1264693407@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to  (sriggs@postgresql.org (Simon Riggs))
Responses Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to
List pgsql-committers
sriggs@postgresql.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

pgsql-committers by date:

Previous
From: mha@postgresql.org (Magnus Hagander)
Date:
Subject: pgsql: Add functions to reset the statistics counter for a single
Next
From: Simon Riggs
Date:
Subject: Re: pgsql: Use malloc() in GetLockConflicts() when called InHotStandby to