From 1e980b6bc8315d00a07312b25486531247abd98c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Jan 2013 18:36:06 -0800 Subject: Fix the duplication in the debugging code. We had two copies of the backtrace code, and two copies of the libcorkscrew /proc/pid/maps code. This patch gets us down to one. We also had hacks so we could log in the malloc debugging code. This patch pulls the non-allocating "printf" code out of the dynamic linker so everyone can share. This patch also makes the leak diagnostics easier to read, and makes it possible to paste them directly into the 'stack' tool (by using relative PCs). This patch also fixes the stdio standard stream leak that was causing a leak warning every time tf_daemon ran. Bug: 7291287 Change-Id: I66e4083ac2c5606c8d2737cb45c8ac8a32c7cfe8 --- libc/bionic/malloc_debug_leak.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libc/bionic/malloc_debug_leak.cpp') diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp index 090a98185..68b6ae285 100644 --- a/libc/bionic/malloc_debug_leak.cpp +++ b/libc/bionic/malloc_debug_leak.cpp @@ -45,6 +45,7 @@ #include #include +#include "debug_stacktrace.h" #include "dlmalloc.h" #include "logd.h" #include "malloc_debug_common.h" @@ -255,8 +256,6 @@ extern "C" void* fill_memalign(size_t alignment, size_t bytes) { static void* MEMALIGN_GUARD = reinterpret_cast(0xA1A41520); -extern __LIBC_HIDDEN__ int get_backtrace(intptr_t* addrs, size_t max_entries); - extern "C" void* leak_malloc(size_t bytes) { // allocate enough space infront of the allocation to store the pointer for // the alloc structure. This will making free'ing the structer really fast! -- cgit v1.2.3