Restore malloc debug.
Some libc changes were preventing the initialization call from being made. The basic problem appears to be that libc_init_common.c is only built once, and it's only built for the non-debug libc.
This commit is contained in:
parent
b56b5659b3
commit
39f3745cf3
@ -52,10 +52,6 @@ unsigned int __page_shift = PAGE_SHIFT;
|
|||||||
|
|
||||||
int __system_properties_init(void);
|
int __system_properties_init(void);
|
||||||
|
|
||||||
#ifdef MALLOCK_LEAK_CHECK
|
|
||||||
void malloc_debug_init(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void __libc_init_common(uintptr_t *elfdata)
|
void __libc_init_common(uintptr_t *elfdata)
|
||||||
{
|
{
|
||||||
int argc = *elfdata;
|
int argc = *elfdata;
|
||||||
@ -87,9 +83,4 @@ void __libc_init_common(uintptr_t *elfdata)
|
|||||||
|
|
||||||
/* setup system properties - requires environment */
|
/* setup system properties - requires environment */
|
||||||
__system_properties_init();
|
__system_properties_init();
|
||||||
|
|
||||||
/* setup malloc leak checker, requires system properties */
|
|
||||||
#if MALLOC_LEAK_CHECK
|
|
||||||
malloc_debug_init();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,13 @@ void __libc_prenit(void)
|
|||||||
tls_area[TLS_SLOT_BIONIC_PREINIT] = NULL;
|
tls_area[TLS_SLOT_BIONIC_PREINIT] = NULL;
|
||||||
|
|
||||||
__libc_init_common(elfdata);
|
__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,
|
__noreturn void __libc_init(uintptr_t *elfdata,
|
||||||
|
@ -68,6 +68,12 @@ __noreturn void __libc_init(uintptr_t *elfdata,
|
|||||||
/* Initialize the C runtime environment */
|
/* Initialize the C runtime environment */
|
||||||
__libc_init_common(elfdata);
|
__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
|
/* Several Linux ABIs don't pass the onexit pointer, and the ones that
|
||||||
* do never use it. Therefore, we ignore it.
|
* do never use it. Therefore, we ignore it.
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +91,14 @@ static pthread_mutex_t gAllocationsMutex = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
static HashTable gHashTable;
|
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)
|
static int hash_entry_compare(const void* arg1, const void* arg2)
|
||||||
@ -257,12 +264,6 @@ struct AllocationEntry {
|
|||||||
uint32_t guard;
|
uint32_t guard;
|
||||||
};
|
};
|
||||||
|
|
||||||
// =============================================================================
|
|
||||||
// log funtions
|
|
||||||
// =============================================================================
|
|
||||||
|
|
||||||
#define debug_log(format, ...) \
|
|
||||||
__libc_android_log_print(ANDROID_LOG_DEBUG, "malloc_leak", (format), ##__VA_ARGS__ )
|
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// Hash Table functions
|
// Hash Table functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user