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.
In response to
pgsql-hackers by date
|Next:||From: Heikki Linnakangas||Date: 2011-03-31 09:43:26|
|Subject: Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI
plans when a function or DO block is|
|Previous:||From: 高增琦||Date: 2011-03-31 08:46:10|
|Subject: Re: crash-safe visibility map, take four|
pgsql-committers by date
|Next:||From: Heikki Linnakangas||Date: 2011-03-31 09:43:01|
|Subject: pgsql: Don't leak the temporary PLyProcedure struct we create forinlin|
|Previous:||From: Heikki Linnakangas||Date: 2011-03-31 07:20:08|
|Subject: pgsql: Reword the phrase on zero replication_timeout in the docs.|