diff options
author | Werner Koch <[email protected]> | 1998-02-17 20:48:52 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1998-02-17 20:48:52 +0000 |
commit | c8bb57d05d1b237e16f93d95a4df5a1d343c4c5a (patch) | |
tree | 7692d6a234d6c22528ffce134ad0f6c904eaa91f /util/memory.c | |
parent | removed password from key two (diff) | |
download | gnupg-c8bb57d05d1b237e16f93d95a4df5a1d343c4c5a.tar.gz gnupg-c8bb57d05d1b237e16f93d95a4df5a1d343c4c5a.zip |
import works
Diffstat (limited to 'util/memory.c')
-rw-r--r-- | util/memory.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/util/memory.c b/util/memory.c index cd4dc815d..6633b94a6 100644 --- a/util/memory.c +++ b/util/memory.c @@ -101,6 +101,7 @@ static unsigned memtbl_size; /* number of allocated entries */ static unsigned memtbl_len; /* number of used entries */ static struct memtbl_entry *memtbl_unused;/* to keep track of unused entries */ +static void dump_table_at_exit(void); static void dump_table(void); static void check_allmem( const char *info ); @@ -135,8 +136,7 @@ add_entry( byte *p, unsigned n, int mode, const char *info, const char *by ) membug("memory debug table malloc failed\n"); index = 0; memtbl_len = 1; - if( DBG_MEMSTAT ) - atexit( dump_table ); + atexit( dump_table_at_exit ); } else { /* realloc */ unsigned n = memtbl_size / 4; /* enlarge by 25% */ @@ -264,6 +264,14 @@ dump_entry(struct memtbl_entry *e ) } + +static void +dump_table_at_exit( void) +{ + if( DBG_MEMSTAT ) + dump_table(); +} + static void dump_table( void) { |