4 my @accv = /(^-+ \w+ -- \d+ --(?:.(?!^-))+)/msg;
5 my @leak = /(\d+ bytes? in \d+ leaks? .+? created at:(?:.(?!^\d))+)/msg;
7 $leak[ 0] =~ s/.* were found:\n\n//m; # Snip off totals.
8 $leak[-1] =~ s/^-+.*//ms; # Snip off final memory layout.
10 # Weed out the known access violations.
12 @accv = grep { ! /-- ru[hs] --.+setlocale.+Perl_init_i18nl10n/s } @accv;
13 @accv = grep { ! /-- (?:fon|ris) --.+__strxfrm_sb/s } @accv;
14 @accv = grep { ! /-- rih --.+memmove.+sv_catpv.+moreswitches/s } @accv;
15 @accv = grep { ! /-- (?:rih|rus) --.+strcpy.+gv_fetchfile/s } @accv;
16 @accv = grep { ! /-- rus --.+_doprnt_dis/s } @accv;
17 @accv = grep { ! /-- rih --.+strcmp.+doopen_pmc/s } @accv;
18 @accv = grep { ! /-- rih --.+memmove.+my_setenv/s } @accv;
20 # Weed out the known memory leaks.
22 @leak = grep { ! /setlocale.+Perl_init_i18nl10n/s } @leak;
23 @leak = grep { ! /setlocale.+set_numeric_standard/s } @leak;
24 @leak = grep { ! /_findiop.+fopen/s } @leak;
25 @leak = grep { ! /_findiop.+__fdopen/s } @leak;
26 @leak = grep { ! /Perl_new\w+.+Perl_yyparse/s } @leak;
28 # Output the cleaned up report.
32 for (my $i = 0; $i < @accv; $i++) {
40 my ($leakb, $leakn, $leaks);
42 for (my $i = 0; $i < @leak; $i++) {
45 /^(\d+) bytes? in (\d+) leak/;
48 $leaks += $1 if /including (\d+) super/;
51 print "Bytes $leakb Leaks $leakn Super $leaks\n" if $leakb;