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

From Heikki Linnakangas
Subject Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Date
Msg-id 4D944CBE.1050307@enterprisedb.com
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is  (Jan Urbański <wulczer@wulczer.org>)
List 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


pgsql-hackers by date:

Previous
From: Jan Urbański
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Next
From: Noah Misch
Date:
Subject: Re: BUG #5856: pg_attribute.attinhcount is not correct.