~yolanda.robla/ubuntu/saucy/clamav/dep-8-tests

« back to all changes in this revision

Viewing changes to contrib/mpoolparse/process.pl

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2009-11-02 23:27:19 UTC
  • mfrom: (0.35.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091102232719-61ay35095dhbuxfm
Tags: 0.95.3+dfsg-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build-dep on electric-fence (in Universe)
  - Build-dep on libltdl3-dev instead of libltdl-dev for updating earlier
    releases more easily
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
use strict;
3
 
use warnings;
4
 
 
5
 
my %reallocs;
6
 
my %mallocs;
7
 
while (<>) {
8
 
    if (/realloc @ 0x([0-9a-f]+)/) {
9
 
        $reallocs{$1}="";
10
 
    }
11
 
    if (/malloc 0x([0-9a-f]+) size ([0-9]+)/) {
12
 
        $mallocs{$1}=$2;
13
 
    }
14
 
}
15
 
my %sizes;
16
 
while (my ($address, $size) = each(%mallocs)) {
17
 
    if (not defined $reallocs{$address}) {
18
 
        $sizes{$size}++;
19
 
    }
20
 
}
21
 
while (my ($size, $count) = each(%sizes)) {
22
 
    print "$size, /* $count */\n";
23
 
}