On Jan 4, 2012, at 2:48 PM, Andrew Dunstan wrote:

>> That's kinda grotty ... and leaky ...
>> 
> 
> Of course it is. It wasn't meant as a solution but as validation of your 
> suspicions about the nature of the problem. (The leakiness could be solved, 
> though.)

From #p5p on irc.perl.org:

[10:58pm]dg:interesting, so SvPV() handles string overloading, but SvPVutf8() 
doesn't, yet: "Like C<SvPV>, but converts sv to utf8 first if necessary."
[10:58pm]dg:oh, only for readonly objects
[10:58pm]dg:probably why no-one has noticed, as version is probably the only 
readonly thing with string overloading
[11:08pm]TonyC:it doesn't need string overloading
[11:09pm]TonyC:https://gist.github.com/1562734
[11:12pm]TonyC:theory: using sv_mortalcopy() instead of newSVsv() should 
prevent the leak in that workaround, assuming there's no FREETMPS between the 
call and use of the return value

Useful?

David


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to