Increase leak detective backtrace depth by a frame

This commit is contained in:
Martin Willi
2012-07-13 13:23:29 +02:00
parent 6499354e4a
commit 549eba30ab
+4 -4
View File
@@ -474,7 +474,7 @@ void *malloc_hook(size_t bytes, const void *caller)
hdr->magic = MEMORY_HEADER_MAGIC; hdr->magic = MEMORY_HEADER_MAGIC;
hdr->bytes = bytes; hdr->bytes = bytes;
hdr->backtrace = backtrace_create(3); hdr->backtrace = backtrace_create(2);
tail->magic = MEMORY_TAIL_MAGIC; tail->magic = MEMORY_TAIL_MAGIC;
install_hooks(); install_hooks();
@@ -543,7 +543,7 @@ void free_hook(void *ptr, const void *caller)
/* memory was not allocated by our hooks */ /* memory was not allocated by our hooks */
fprintf(stderr, "freeing invalid memory (%p)", ptr); fprintf(stderr, "freeing invalid memory (%p)", ptr);
} }
backtrace = backtrace_create(3); backtrace = backtrace_create(2);
backtrace->log(backtrace, stderr, TRUE); backtrace->log(backtrace, stderr, TRUE);
backtrace->destroy(backtrace); backtrace->destroy(backtrace);
} }
@@ -601,7 +601,7 @@ void *realloc_hook(void *old, size_t bytes, const void *caller)
{ {
fprintf(stderr, "reallocating invalid memory (%p):\n" fprintf(stderr, "reallocating invalid memory (%p):\n"
"header magic 0x%x:\n", old, hdr->magic); "header magic 0x%x:\n", old, hdr->magic);
backtrace = backtrace_create(3); backtrace = backtrace_create(2);
backtrace->log(backtrace, stderr, TRUE); backtrace->log(backtrace, stderr, TRUE);
backtrace->destroy(backtrace); backtrace->destroy(backtrace);
} }
@@ -617,7 +617,7 @@ void *realloc_hook(void *old, size_t bytes, const void *caller)
/* update statistics */ /* update statistics */
hdr->bytes = bytes; hdr->bytes = bytes;
hdr->backtrace->destroy(hdr->backtrace); hdr->backtrace->destroy(hdr->backtrace);
hdr->backtrace = backtrace_create(3); hdr->backtrace = backtrace_create(2);
/* update header of linked list neighbours */ /* update header of linked list neighbours */
if (hdr->next) if (hdr->next)