From 7d54fd5dba4ddc8f30fd76f8f7fc1acaf626b457 Mon Sep 17 00:00:00 2001 From: Andy Grundman Date: Fri, 4 Jun 2010 17:46:10 -0400 Subject: [PATCH] Memory leak test script --- tools/leak.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tools/leak.pl diff --git a/tools/leak.pl b/tools/leak.pl new file mode 100755 index 0000000..b99a672 --- /dev/null +++ b/tools/leak.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +use lib qw(blib/lib blib/arch); +use MP3::Cut::Gapless; +use Time::HiRes qw(sleep); + +my $file = shift; +my $n = 0; + +for ( 1..50000 ) { + my $cut = MP3::Cut::Gapless->new( + file => $file, + start_ms => 1000, + end_ms => 2000, + ); + + while ( $cut->read( my $buf, 4096 ) ) { } + + sleep 0.001; +}