checked in Perl script for tracking down memory leaks

This commit is contained in:
Andreas Gustafsson
1999-12-14 02:07:27 +00:00
parent 8146ee1fac
commit 19d2b70b53

10
util/memleak.pl Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/perl
# Massage the output from ISC_MEM_DEBUG to extract mem_get() calls
# with no corresponding mem_put().
while (<>) {
$gets{$1.$2} = $_ if /mem(pool)?_get.*-> 0x([0-9a-f]+)/;
delete $gets{$1.$2} if /mem(pool)?_put\(0x[0-9a-f]+, 0x([0-9a-f]+)/;
}
print join('', values %gets);