am 39f3745c: Restore malloc debug.

Merge commit '39f3745cf30efe38482ffead1c32f4e62f6fe32e'

* commit '39f3745cf30efe38482ffead1c32f4e62f6fe32e':
  Restore malloc debug.
This commit is contained in:
Andy McFadden 2009-07-21 16:40:00 -07:00 committed by Android Git Automerger
commit e40fb3d68f
4 changed files with 21 additions and 16 deletions

View File

@ -52,10 +52,6 @@ unsigned int __page_shift = PAGE_SHIFT;
int __system_properties_init(void);
#ifdef MALLOCK_LEAK_CHECK
void malloc_debug_init(void);
#endif
void __libc_init_common(uintptr_t *elfdata)
{
int argc = *elfdata;
@ -87,9 +83,4 @@ void __libc_init_common(uintptr_t *elfdata)
/* setup system properties - requires environment */
__system_properties_init();
/* setup malloc leak checker, requires system properties */
#if MALLOC_LEAK_CHECK
malloc_debug_init();
#endif
}

View File

@ -77,6 +77,13 @@ void __libc_prenit(void)
tls_area[TLS_SLOT_BIONIC_PREINIT] = NULL;
__libc_init_common(elfdata);
#ifdef MALLOC_LEAK_CHECK
/* setup malloc leak checker, requires system properties */
extern void malloc_debug_init(void);
malloc_debug_init();
#endif
}
__noreturn void __libc_init(uintptr_t *elfdata,

View File

@ -68,6 +68,12 @@ __noreturn void __libc_init(uintptr_t *elfdata,
/* Initialize the C runtime environment */
__libc_init_common(elfdata);
#ifdef MALLOC_LEAK_CHECK
/* setup malloc leak checker, requires system properties */
extern void malloc_debug_init(void);
malloc_debug_init();
#endif
/* Several Linux ABIs don't pass the onexit pointer, and the ones that
* do never use it. Therefore, we ignore it.
*/

View File

@ -91,7 +91,14 @@ static pthread_mutex_t gAllocationsMutex = PTHREAD_MUTEX_INITIALIZER;
static HashTable gHashTable;
// =============================================================================
// output fucntions
// log functions
// =============================================================================
#define debug_log(format, ...) \
__libc_android_log_print(ANDROID_LOG_DEBUG, "malloc_leak", (format), ##__VA_ARGS__ )
// =============================================================================
// output functions
// =============================================================================
static int hash_entry_compare(const void* arg1, const void* arg2)
@ -257,12 +264,6 @@ struct AllocationEntry {
uint32_t guard;
};
// =============================================================================
// log funtions
// =============================================================================
#define debug_log(format, ...) \
__libc_android_log_print(ANDROID_LOG_DEBUG, "malloc_leak", (format), ##__VA_ARGS__ )
// =============================================================================
// Hash Table functions