Re: plperl and inline functions -- first draft

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexey Klyukin <alexk(at)commandprompt(dot)com>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, Joshua Tolley <eggyknap(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: plperl and inline functions -- first draft
Date: 2009-11-29 02:40:34
Message-ID: 2733.1259462434@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alexey Klyukin <alexk(at)commandprompt(dot)com> writes:
> On Nov 20, 2009, at 3:50 PM, Tim Bunce wrote:
>> When does the reference held by desc.reference get freed?
>> At the moment it looks like this would leak memory for each DO.

> Isn't it also the case with the existing plperl code ? I've noticed that free(prodesc) is called when it's no longer used (i.e. in plperl_compile_callback:1636), but refcount of desc->reference is never decremented.

I've been experimenting with this and confirmed that there is a leak;
not only in the DO patch but in the pre-existing code, if a plperl
function is redefined repeatedly.

Is this the correct way to release the SV* reference?

if (reference)
SvREFCNT_dec(reference);

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2009-11-29 02:54:20 Re: patch - per-tablespace random_page_cost/seq_page_cost
Previous Message Robert Haas 2009-11-29 02:19:42 Re: Re: [COMMITTERS] pgsql: Rewrite GEQO's gimme_tree function so that it always finds a