$ perl -e'use Devel::LeakTrace::Fast; { my $x = []; }' leaked SV(0x0x814ec28) from -e line 1 leaked SV(0x0x814ed84) from -e line 1 $ perl -e'use Devel::LeakTrace::Fast; { my $x = []; 1; }' $ perl -e'use Devel::LeakTrace::Fast; { my $x = []; } 1;' $
I suspect the value to which the sassign (=) evaluates (the reference returned by []) is on the stack for some unknown reason. As show, it doesn't stay there if you add *anything* to the program. So not a leak. For example, the only difference in the above "leaking" and fine code is an op used to give line numbers to warnings.
$ diff -u \ > <( perl -MO=Concise,-exec -we'use Devel::LeakTrace::Fast; { my $x + = []; } ' 2>&1 ) \ > <( perl -MO=Concise,-exec -we'use Devel::LeakTrace::Fast; { my $x + = []; } 1' 2>&1 ) --- /dev/fd/63 2009-04-21 15:31:32.471371429 -0400 +++ /dev/fd/62 2009-04-21 15:31:32.475372857 -0400 @@ -9,4 +9,5 @@ 8 <0> padsv[$x:279,280] sRM*/LVINTRO 9 <2> sassign vKS/2 a <2> leaveloop vK/2 +b <;> nextstate(main 281 -e:1) v <-- only difference -b <@> leave[1 ref] vKP/REFC +c <@> leave[1 ref] vKP/REFC
Oddly, I can't reproduce it using
$ perl -e'use Devel::LeakTrace::Fast; { my $x = []; $x }' $
The two values being "leaked", incidentally, must be the reference and the array being referenced.
In reply to Re: question about Devel::LeakTrace::Fast
by ikegami
in thread question about Devel::LeakTrace::Fast
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |