diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2014-05-09 15:00:09 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2014-05-09 22:22:34 +0400 |
commit | 07f0a8dbc9ff6638344f13875925408dd6e2aa2c (patch) | |
tree | f8b9c2262e632feb9b41ed7d8700cbd6bdafc5dc /misc | |
parent | 5b144751eeb0fecf29a508278045ff79038dd7c3 (diff) | |
download | nasm-07f0a8dbc9ff6638344f13875925408dd6e2aa2c.tar.gz |
debug: Drop LOGALLOC usage
There are special tools (like valgrind and etc)
to track memory leaks, no need for own trivial
tracker.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/findleak.pl | 42 | ||||
-rw-r--r-- | misc/findleak.txt | 59 |
2 files changed, 0 insertions, 101 deletions
diff --git a/misc/findleak.pl b/misc/findleak.pl deleted file mode 100755 index dbb33671..00000000 --- a/misc/findleak.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl -# From: Ed Beroset <beroset@mindspring.com> - -my %mem = {}; -my %alloc = {}; -while(<>) -{ - if (/realloc\((0x[0-9a-f]+).*\).*returns \((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - if ($mem{$2} != 0) { - print "memory leak! $_"; - } - $mem{$2}++; - $alloc{$2} = $_; - } - elsif (/free\((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - } - elsif (m/returns (0x[0-9a-f]+)/) - { - if ($mem{$1} != 0) { - print "memory leak! $_"; - } - $mem{$1}++; - $alloc{$1} = $_; - } -} -foreach $goo (sort keys %mem) -{ - if ($mem{$goo}) - { - print "$mem{$goo} $alloc{$goo}"; - } -} diff --git a/misc/findleak.txt b/misc/findleak.txt deleted file mode 100644 index 8a1cfdc1..00000000 --- a/misc/findleak.txt +++ /dev/null @@ -1,59 +0,0 @@ -Subject: [nasm-devel] tool to help find memory leaks -Date: Fri, 02 Nov 2001 22:08:01 -0500 -From: Ed Beroset <beroset@mindspring.com> -Reply-To: nasm-devel@yahoogroups.com -To: nasm-devel@yahoogroups.com - -Here's a little Perl script I wrote a while ago to help track down memory -leaks in nasm. First, compile nasm with LOGALLOC defined (see -nasmlib.c). That creates a log file of all allocs and frees. This Perl -script reads that file and tells you which source code lines caused a leak -(or a free of unallocated memory). There are many leaks, almost all of -them in the preprocessor. - --+--- findleak.pl begins -#!/usr/bin/perl -my %mem = {}; -my %alloc = {}; -while(<>) -{ - if (/realloc\((0x[0-9a-f]+).*\).*returns \((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - if ($mem{$2} != 0) { - print "memory leak! $_"; - } - $mem{$2}++; - $alloc{$2} = $_; - } - elsif (/free\((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - } - elsif (m/returns (0x[0-9a-f]+)/) - { - if ($mem{$1} != 0) { - print "memory leak! $_"; - } - $mem{$1}++; - $alloc{$1} = $_; - } -} -foreach $goo (sort keys %mem) -{ - if ($mem{$goo}) - { - print "$mem{$goo} $alloc{$goo}"; - } -} --+--- findleak.pl ends - - - -Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ |