Add support for scudo.
As the first pass, the malloc_info for scudo doesn't return anything. This feature is hardly ever used, so this seems fine for the first revision. Bug: 137795072 Test: Ran unit tests on a taimen using scudo and a taimen using jemalloc. Change-Id: I675386ae17ba5505c27bd9da12c60242d795464a
This commit is contained in:
parent
57f01b91d7
commit
85169658e1
|
@ -371,7 +371,8 @@ TEST(malloc, malloc_info) {
|
||||||
auto root = doc.FirstChildElement();
|
auto root = doc.FirstChildElement();
|
||||||
ASSERT_NE(nullptr, root);
|
ASSERT_NE(nullptr, root);
|
||||||
ASSERT_STREQ("malloc", root->Name());
|
ASSERT_STREQ("malloc", root->Name());
|
||||||
if (std::string(root->Attribute("version")) == "jemalloc-1") {
|
std::string version(root->Attribute("version"));
|
||||||
|
if (version == "jemalloc-1") {
|
||||||
// Verify jemalloc version of this data.
|
// Verify jemalloc version of this data.
|
||||||
ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
|
ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
|
||||||
|
|
||||||
|
@ -404,9 +405,9 @@ TEST(malloc, malloc_info) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Only verify that this is debug-malloc-1, the malloc debug unit tests
|
// Do not verify output for scudo or debug malloc.
|
||||||
// verify the output.
|
ASSERT_TRUE(version == "scudo-1" || version == "debug-malloc-1")
|
||||||
ASSERT_STREQ("debug-malloc-1", root->Attribute("version"));
|
<< "Unknown version: " << version;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -431,7 +432,8 @@ TEST(malloc, malloc_info_matches_mallinfo) {
|
||||||
auto root = doc.FirstChildElement();
|
auto root = doc.FirstChildElement();
|
||||||
ASSERT_NE(nullptr, root);
|
ASSERT_NE(nullptr, root);
|
||||||
ASSERT_STREQ("malloc", root->Name());
|
ASSERT_STREQ("malloc", root->Name());
|
||||||
if (std::string(root->Attribute("version")) == "jemalloc-1") {
|
std::string version(root->Attribute("version"));
|
||||||
|
if (version == "jemalloc-1") {
|
||||||
// Verify jemalloc version of this data.
|
// Verify jemalloc version of this data.
|
||||||
ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
|
ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
|
||||||
|
|
||||||
|
@ -458,9 +460,9 @@ TEST(malloc, malloc_info_matches_mallinfo) {
|
||||||
EXPECT_LE(mallinfo_before_allocated_bytes, total_allocated_bytes);
|
EXPECT_LE(mallinfo_before_allocated_bytes, total_allocated_bytes);
|
||||||
EXPECT_GE(mallinfo_after_allocated_bytes, total_allocated_bytes);
|
EXPECT_GE(mallinfo_after_allocated_bytes, total_allocated_bytes);
|
||||||
} else {
|
} else {
|
||||||
// Only verify that this is debug-malloc-1, the malloc debug unit tests
|
// Do not verify output for scudo or debug malloc.
|
||||||
// verify the output.
|
ASSERT_TRUE(version == "scudo-1" || version == "debug-malloc-1")
|
||||||
ASSERT_STREQ("debug-malloc-1", root->Attribute("version"));
|
<< "Unknown version: " << version;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue