diff options
author | Joe Thornber <thornber@redhat.com> | 2001-10-04 10:13:07 +0000 |
---|---|---|
committer | Joe Thornber <thornber@redhat.com> | 2001-10-04 10:13:07 +0000 |
commit | e6efb2b0bde731b26604bf9cbe80b63dc19a5145 (patch) | |
tree | 257261543df9a3a2b03ce2a2525265aaff92f37c /old-tests | |
parent | 5bdbd4b380e83b8fe38f41ee4b0ee9838333e34a (diff) | |
download | lvm2-e6efb2b0bde731b26604bf9cbe80b63dc19a5145.tar.gz lvm2-e6efb2b0bde731b26604bf9cbe80b63dc19a5145.tar.xz lvm2-e6efb2b0bde731b26604bf9cbe80b63dc19a5145.zip |
o got dbg_malloc_t working, Alasdair could you look at the Makefile.in it
seems to be having trouble with the dependencies.
o removed some files from the lib makefile that don't compile yet.
Diffstat (limited to 'old-tests')
-rw-r--r-- | old-tests/mm/dbg_malloc_t.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/old-tests/mm/dbg_malloc_t.c b/old-tests/mm/dbg_malloc_t.c index 99831e40..81fca05b 100644 --- a/old-tests/mm/dbg_malloc_t.c +++ b/old-tests/mm/dbg_malloc_t.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 Sistina Software + * Copyright (C) 2001 Sistina Software (UK) Limited * * This file is released under the GPL. */ @@ -30,7 +30,7 @@ struct block_list { static void _leak_memory(void) { int i; - struct block_list *b, *head, **l = &head; + struct block_list *b, *head, **l = &head, *n; /* allocate a list of blocks */ for (i = 0; i < 1000; i++) { @@ -39,20 +39,21 @@ static void _leak_memory(void) log_fatal("Couldn't allocate memory"); exit(1); } - + b->next = 0; *l = b; l = &b->next; } /* free off every other block */ - for (i = 0, l = head; *l; l = &(*l)->next, i++) { + for (b = head, i = 0; b; b = n, i++) { + n = b->next; if(i & 0x1) - db_free(b); + dbg_free(b); } } -static void _bounds_overrun() +static void _bounds_overrun(void) { char *b; @@ -66,7 +67,7 @@ static void _bounds_overrun() dbg_free(b); } -static void _bounds_underrun() +static void _bounds_underrun(void) { char *b; @@ -80,7 +81,7 @@ static void _bounds_underrun() dbg_free(b); } -static void _free_dud() +static void _free_dud(void) { char *b; @@ -91,7 +92,7 @@ static void _free_dud() dbg_free(b + 100); } -static void _free_twice() +static void _free_twice(void) { char *b; @@ -107,7 +108,8 @@ int main(int argc, char **argv) { char opt; - init_log(); + init_log(stderr); + init_debug(_LOG_DEBUG); opt = getopt(argc, argv, "hlbufd"); switch(opt) { case EOF: |