summaryrefslogtreecommitdiffstats
path: root/libc/bionic/malloc_debug_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/malloc_debug_common.cpp')
-rw-r--r--libc/bionic/malloc_debug_common.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libc/bionic/malloc_debug_common.cpp b/libc/bionic/malloc_debug_common.cpp
index 0b6a142..ee796c6 100644
--- a/libc/bionic/malloc_debug_common.cpp
+++ b/libc/bionic/malloc_debug_common.cpp
@@ -29,19 +29,19 @@
// Contains definition of structures, global variables, and implementation of
// routines that are used by malloc leak detection code and other components in
// the system. The trick is that some components expect these data and
-// routines to be defined / implemented in libc.so library, regardless
-// whether or not MALLOC_LEAK_CHECK macro is defined. To make things even
-// more tricky, malloc leak detection code, implemented in
-// libc_malloc_debug.so also requires access to these variables and routines
-// (to fill allocation entry hash table, for example). So, all relevant
-// variables and routines are defined / implemented here and exported
-// to all, leak detection code and other components via dynamic (libc.so),
-// or static (libc.a) linking.
+// routines to be defined / implemented in libc.so, regardless whether or not
+// malloc leak detection code is going to run. To make things even more tricky,
+// malloc leak detection code, implemented in libc_malloc_debug.so also
+// requires access to these variables and routines (to fill allocation entry
+// hash table, for example). So, all relevant variables and routines are
+// defined / implemented here and exported to all, leak detection code and
+// other components via dynamic (libc.so), or static (libc.a) linking.
#include "malloc_debug_common.h"
#include <pthread.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "private/ScopedPthreadMutexLocker.h"
@@ -402,7 +402,7 @@ static void malloc_init_impl() {
}
// Load .so that implements the required malloc debugging functionality.
- void* malloc_impl_handle = dlopen(so_name, RTLD_LAZY);
+ void* malloc_impl_handle = dlopen(so_name, RTLD_NOW);
if (malloc_impl_handle == NULL) {
error_log("%s: Missing module %s required for malloc debug level %d: %s",
getprogname(), so_name, g_malloc_debug_level, dlerror());