Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Jan Urbański <wulczer(at)wulczer(dot)org>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Date: 2011-03-31 09:43:26
Message-ID: 4D944CBE.1050307@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 31.03.2011 12:30, Jan Urbański wrote:
> On 31/03/11 07:35, Heikki Linnakangas wrote:
>> On 30.03.2011 21:21, Jan Urbański wrote:
>>> Valgrind showed me the way. PFA a trivial patch to avoid leaking a
>>> PLyProcedure struct in inline blocks.
>>
>> Hmm, any reason the PLyProcedure struct needs to be allocated in
>> TopMemoryContext in the first place? Could you palloc0 it in a
>> shorter-lived context, or even better, just allocate it in stack?
>
> Yeah, you're right, you can keep it on the stack.
>
>> PS. I don't think the volatile qualifier in 'proc' is in necessary. The
>> variable is not changed in PG_TRY-block.
>
> That always confuses me, but I guess you're right, the variable does not
> change, only the memory it points to.

Ok then, committed.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-03-31 10:41:35 pgsql: Increase SHMEM_INDEX_SIZE from 32 to 64. We're currently at 40 e
Previous Message Heikki Linnakangas 2011-03-31 09:43:01 pgsql: Don't leak the temporary PLyProcedure struct we create for inlin

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-03-31 10:06:49 Re: BUG #5856: pg_attribute.attinhcount is not correct.
Previous Message Jan Urbański 2011-03-31 09:30:29 Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is