Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88bef19e authored by Christopher Ferris's avatar Christopher Ferris Committed by Gerrit Code Review
Browse files

Merge "Add support for scudo native allocator."

parents 3a8974d0 5db00928
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>

using namespace std;
using namespace android::meminfo;
@@ -334,7 +335,9 @@ TEST(ProcMemInfo, ForEachVmaFromFileTest) {
    // Check for names
    EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]");
    EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art");
    EXPECT_EQ(vmas[2].name, "[anon:libc_malloc]");
    EXPECT_TRUE(vmas[2].name == "[anon:libc_malloc]" ||
                android::base::StartsWith(vmas[2].name, "[anon:scudo:"))
            << "Unknown map name " << vmas[2].name;
    EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex");
    EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so");
    EXPECT_EQ(vmas[5].name, "[vsyscall]");
@@ -432,7 +435,9 @@ TEST(ProcMemInfo, SmapsTest) {
    // Check for names
    EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]");
    EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art");
    EXPECT_EQ(vmas[2].name, "[anon:libc_malloc]");
    EXPECT_TRUE(vmas[2].name == "[anon:libc_malloc]" ||
                android::base::StartsWith(vmas[2].name, "[anon:scudo:"))
            << "Unknown map name " << vmas[2].name;
    EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex");
    EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so");
    EXPECT_EQ(vmas[5].name, "[vsyscall]");
+3 −1
Original line number Diff line number Diff line
@@ -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 @@ bool MemUnreachable::ClassifyMappings(const allocator::vector<Mapping>& mappings
    } 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-")) {