diff options
Diffstat (limited to 'libc/malloc_debug')
-rw-r--r-- | libc/malloc_debug/Android.bp | 2 | ||||
-rw-r--r-- | libc/malloc_debug/malloc_debug.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libc/malloc_debug/Android.bp b/libc/malloc_debug/Android.bp index bcbd7dac9..aae16f14d 100644 --- a/libc/malloc_debug/Android.bp +++ b/libc/malloc_debug/Android.bp @@ -3,8 +3,8 @@ // ============================================================== // Used by libmemunreachable cc_library_static { - name: "libc_malloc_debug_backtrace", + vendor_available: true, srcs: [ "backtrace.cpp", diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp index 423363fa9..d2679ca4c 100644 --- a/libc/malloc_debug/malloc_debug.cpp +++ b/libc/malloc_debug/malloc_debug.cpp @@ -258,12 +258,19 @@ static void* InitHeader(Header* header, void* orig_pointer, size_t size) { return g_debug->GetPointer(header); } +extern "C" void __asan_init() __attribute__((weak)); + bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* zygote_child, const char* options) { if (zygote_child == nullptr || options == nullptr) { return false; } + if (__asan_init != 0) { + error_log("malloc debug cannot be enabled alongside ASAN"); + return false; + } + InitAtfork(); g_zygote_child = zygote_child; |