projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged from silc_1_0_branch.
[silc.git]
/
lib
/
silcutil
/
stacktrace.c
diff --git
a/lib/silcutil/stacktrace.c
b/lib/silcutil/stacktrace.c
index eb8f2458e1b468965243cd5206a1f4def588fa72..38aae9545c22c0ee88f259f0a4e8b0ccdb6757b2 100644
(file)
--- a/
lib/silcutil/stacktrace.c
+++ b/
lib/silcutil/stacktrace.c
@@
-23,7
+23,8
@@
static void *st_blocks = NULL;
static unsigned long st_blocks_count = 0;
static void *st_blocks = NULL;
static unsigned long st_blocks_count = 0;
-static int dump = FALSE;
+static bool dump = FALSE;
+static bool malloc_check = FALSE;
#define SILC_ST_DEPTH 10
#define SILC_ST_DEPTH 10
@@
-62,6
+63,16
@@
void silc_st_stacktrace(SilcStBlock stack)
dump = TRUE;
}
dump = TRUE;
}
+ if (!malloc_check) {
+ /* Linux libc malloc check */
+ setenv("MALLOC_CHECK_", "2", 1);
+
+ /* NetBSD malloc check */
+ setenv("MALLOC_OPTIONS", "AJ", 1);
+
+ malloc_check = TRUE;
+ }
+
/* Save the stack */
SILC_ST_GET_FP(fp);
for (stack->depth = 0; fp; stack->depth++) {
/* Save the stack */
SILC_ST_GET_FP(fp);
for (stack->depth = 0; fp; stack->depth++) {