in reply to XS: Manipulating refcounts
You're already doing all the right things - looking at the objects with Devel::Peek, storing a blessed IV, etc. Nice work. This is similar to a module I maintain, Set::Object.
I think all that's happening is that at global destruction time, structures aren't cleaned up in the normal way. After all, you still want destructors for objects in circular references to be called. Instead Perl just calls destructors for all objects, and it wouldn't surprise me if it did that without dropping refcnt values first.
Perhaps try changing your test program to trigger the objects falling out of scope before the end of the program is reached.
I also remember having to use the sv2mortal range of macros, perhaps have a look at those too if the above doesn't help.
$h=$ENV{HOME};my@q=split/\n\n/,`cat $h/.quotes`;$s="$h/." ."signature";$t=`cat $s`;print$t,"\n",$q[rand($#q)],"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XS: Manipulating refcounts
by creamygoodness (Curate) on Sep 19, 2006 at 06:56 UTC | |
by syphilis (Archbishop) on Sep 19, 2006 at 11:34 UTC | |
by creamygoodness (Curate) on Sep 19, 2006 at 11:59 UTC |