memleak.pl revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 1999, 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# copyright notice and this permission notice appear in all copies.
6c6ccd6b330fa92d62136ec1062cc07a790a7165Automatic Updater# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
490b05960c9956cc37f52f5fd4443829d75ce7d6Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2d96b63d311a5252c8583eb30a56b1fc58172419Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ecc06cbc32c5a2b91a17e65c1820c9c66313d35cMukund Sivaraman# $Id: memleak.pl,v 1.9 2000/08/01 01:33:29 tale Exp $
214836c18496e0d2630df1cda5eeee13c38b9068Evan Hunt# Massage the output from ISC_MEM_DEBUG to extract mem_get() calls
43b9737b11f4f14b2d378746d0cd5561b1dc24a0Mark Andrews# with no corresponding mem_put().
2d96b63d311a5252c8583eb30a56b1fc58172419Mark Andrews $gets{$1.$2} = $_ if (/mem_get\((?:0x)?([0-9a-f]+), (?:0x)?[0-9a-f]+\) -> (?:0x)?([0-9a-f]+)/);
2d96b63d311a5252c8583eb30a56b1fc58172419Mark Andrews delete $gets{$1.$2} if /mem_put\((?:0x)?([0-9a-f]+), (?:0x)?([0-9a-f]+), (?:0x)?[0-9a-f]+\)/;
ecc06cbc32c5a2b91a17e65c1820c9c66313d35cMukund Sivaraman $mem_stats .= $_ if /\d+ gets, +(\d+) rem/ && $1 > 0;