Search   Feed   Browse   Add
Feed items 1 - 1 of 1 for November 2007

perl.xs

...

Reference counting by Steve Fink - November 10, 2007

Why does the following code leak memory void leak() ENTER; SAVETMPS; SV node_var = get_sv("main::SOMETHING", TRUE); save_item(node_var); SV obj_ref = sv_setref_iv(newSV(0), "My::Package", 0xdeadbeef); SvSetSV(node_var, obj_ref); SvREFCNT_dec(obj_ref); do stuff FREETMPS; LEAVE; I run that in a while(1) loop and it leaks memory like crazy. Ioriginally didn&39;t have the SvREFCNT_dec() in there, because I thoughtSvSetSV would take ownership of the source..
http://www.nntp.perl.org/group/perl.xs/2007/11/msg2432.html
Available Archives
- October (1 item)
- November (1 item)
- December (6 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact