ClamAV is an open source (GPLv2) anti-virus toolkit.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
clamav/contrib/mpoolparse/process.pl

24 lines
428 B

#!/usr/bin/perl
use strict;
use warnings;
my %reallocs;
my %mallocs;
while (<>) {
if (/realloc @ 0x([0-9a-f]+)/) {
$reallocs{$1}="";
}
if (/malloc 0x([0-9a-f]+) size ([0-9]+)/) {
$mallocs{$1}=$2;
}
}
my %sizes;
while (my ($address, $size) = each(%mallocs)) {
if (not defined $reallocs{$address}) {
$sizes{$size}++;
}
}
while (my ($size, $count) = each(%sizes)) {
print "$size, /* $count */\n";
}