X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fstacktrace.c;h=1eecca1dea8b62b4aa6432ea99cb9e999c64d418;hb=c1c904ec2af21f1c2b272d790b38d93824af5352;hp=2174080cf867202275fae67a9613cf26c3ad6883;hpb=db5f308b9a3897c74514ad5b366fb43dfec52a7c;p=silc.git diff --git a/lib/silcutil/stacktrace.c b/lib/silcutil/stacktrace.c index 2174080c..1eecca1d 100644 --- a/lib/silcutil/stacktrace.c +++ b/lib/silcutil/stacktrace.c @@ -1,10 +1,10 @@ /* - stacktrace.c + stacktrace.c Author: Pekka Riikonen - Copyright (C) 2002 Pekka Riikonen + Copyright (C) 2002, 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,11 @@ static unsigned long st_blocks_count = 0; static SilcBool dump = FALSE; static SilcBool malloc_check = FALSE; -#define SILC_ST_DEPTH 10 +#ifdef SILC_DEBUG +#define SILC_ST_DEPTH 15 +#else +#define SILC_ST_DEPTH 8 +#endif /* SILC_DEBUG */ /* Memory block with stack trace */ typedef struct SilcStBlockStruct { @@ -191,7 +195,7 @@ void silc_st_dump(void) for (s = stack; s; s = s->next) { if (s->file == stack->file && s->line == stack->line && s->depth == stack->depth && - !memcmp(s->stack, stack->stack, + !memcmp(s->stack, stack->stack, (s->depth * sizeof(stack->stack[0])))) { blocks++; bytes += s->size; @@ -210,7 +214,7 @@ void silc_st_dump(void) if (!leaks) { fprintf(stderr, "\nNo memory leaks\n"); } else { - fprintf(stderr, + fprintf(stderr, "-----------------------------------------\n" "-----------------------------------------\n" " Memory leaks dumped to 'stacktrace.log'\n"