Perl: fixed memory leak issue

This commit is contained in:
tokuhirom
2010-05-03 00:46:15 +09:00
parent c77eac325e
commit 77d48f9cee
3 changed files with 50 additions and 19 deletions

View File

@@ -54,6 +54,14 @@ sub trace {
my $x = $unpacker->data;
# is_deeply($x, $input) if $i % 100 == 0;
}
$unpacker->reset();
$unpacker->execute($r, 0);
$unpacker->reset();
$unpacker->execute(substr($r, 0, 1), 0);
$unpacker->execute(substr($r, 0, 2), 1);
$unpacker->execute($r, 2);
$unpacker->reset();
$r or die;
}
my $after = memoryusage();
diag("$n\t: $after - $before");