This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
leakfinder.pl: Run code more times
authorFather Chrysostomos <sprout@cpan.org>
Tue, 13 Nov 2012 07:46:16 +0000 (23:46 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 13 Nov 2012 08:01:40 +0000 (00:01 -0800)
Sometimes a piece of code will still create new SVs on the second
or even the third iteration, but not after that.  That doesn’t count
as a leak.

Porting/leakfinder.pl

index babec7c..de9440a 100644 (file)
@@ -33,7 +33,7 @@ for(`find .`) {
             open STDIN, "</dev/null";
             open STDERR, ">/dev/null";
             \$unused_variable = '$q';
-            eval \$unused_variable;
+            eval \$unused_variable for my \$also_unused(1..3);
             print oUt sv_count, "\n";
             eval \$unused_variable;
             print oUt sv_count, "\n";