Re: pgsql: Fix breakage from earlier plperl fix.

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pgsql: Fix breakage from earlier plperl fix.
Дата
Msg-id 4F063979.5090708@dunslane.net
обсуждение исходный текст
Ответ на Re: pgsql: Fix breakage from earlier plperl fix.  (Alex Hunsaker <badalex@gmail.com>)
Ответы Re: pgsql: Fix breakage from earlier plperl fix.  (Alex Hunsaker <badalex@gmail.com>)
Список pgsql-committers

On 01/05/2012 06:31 PM, Alex Hunsaker wrote:
> On Thu, Jan 5, 2012 at 16:02, Andrew Dunstan<andrew@dunslane.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



В списке pgsql-committers по дате отправления:

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: pgsql: Fix breakage from earlier plperl fix.
Следующее
От: Alex Hunsaker
Дата:
Сообщение: Re: pgsql: Fix breakage from earlier plperl fix.