Add support for scudo native allocator.
Bug: 137795072
Test: All unit tests pass when using scudo or jemalloc.
Change-Id: I20c71811d9e43663c495a1e51988acfef9fc8584
diff --git a/MemUnreachable.cpp b/MemUnreachable.cpp
index ce937fd..c4add19 100644
--- a/MemUnreachable.cpp
+++ b/MemUnreachable.cpp
@@ -25,6 +25,7 @@
#include <unordered_map>
#include <android-base/macros.h>
+#include <android-base/strings.h>
#include <backtrace.h>
#include "Allocator.h"
@@ -250,7 +251,8 @@
} else if (mapping_name == current_lib) {
// .rodata or .data section
globals_mappings.emplace_back(*it);
- } else if (mapping_name == "[anon:libc_malloc]") {
+ } else if (mapping_name == "[anon:libc_malloc]" ||
+ android::base::StartsWith(mapping_name, "[anon:scudo:")) {
// named malloc mapping
heap_mappings.emplace_back(*it);
} else if (has_prefix(mapping_name, "[anon:dalvik-")) {