Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Fix breakage from earlier plperl fix.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Fix breakage from earlier plperl fix.
Date: 2012-01-05 23:59:53
Message-ID: 4F063979.5090708@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers

On 01/05/2012 06:31 PM, Alex Hunsaker wrote:
> On Thu, Jan 5, 2012 at 16:02, Andrew Dunstan<andrew(at)dunslane(dot)net>  wrote:
>> Fix breakage from earlier plperl fix.
>>
>> Apparently the perl garbage collector was a bit too eager, so here
>> we control when the new SV is garbage collected.
> I know im a little late to the party...
>
> I can't help but think this seems a bit inefficient for the common
> case. Would it be worth only copying the sv when its a glob or
> readonly? Something like the below? I tested a few more svtypes that
> were easy to make (code, regexp) and everything seems peachy.


I'm not so concerned about elog() use, and anyway there the most common 
case surely will be passing a readonly string.

I'm more concerned about all the other places we call sv2cstr().

"SvTYPE(sv) == SVt_PVGV" is what I was looking for in vain in the perl docs.

So, yes, we should probably adjust this one more time, but ideally we 
need a better test than just SvREADONLY(). If you want to follow up your 
investigation of exactly when we need a copied SV and see how much you 
can narrow it down that would be great.

cheers

andrew



In response to

Responses

pgsql-hackers by date

Next:From: Peter GeogheganDate: 2012-01-06 00:01:10
Subject: Re: Progress on fast path sorting, btree index creation time
Previous:From: Alex HunsakerDate: 2012-01-05 23:31:41
Subject: Re: pgsql: Fix breakage from earlier plperl fix.

pgsql-committers by date

Next:From: Alex HunsakerDate: 2012-01-06 03:59:33
Subject: Re: pgsql: Fix breakage from earlier plperl fix.
Previous:From: Alex HunsakerDate: 2012-01-05 23:31:41
Subject: Re: pgsql: Fix breakage from earlier plperl fix.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group