summaryrefslogtreecommitdiff
path: root/tests/malloc_iterate_test.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-10-02 12:48:23 -0700
committerChristopher Ferris <cferris@google.com>2019-10-02 12:48:23 -0700
commit88b2f0d8f0c0a278d80c5eb93daf272243ae6bf1 (patch)
tree9bff3e666e8f7d853b7a62ee8a5b491c3cb94bcb /tests/malloc_iterate_test.cpp
parentd120b8a06cbcf929bb1dc1b4d81872f8f18c9c6c (diff)
Add support for scudo.
Bug: 137795072 Test: Unit tests pass on jemalloc and scudo. Change-Id: I764cdad2507d322ff36dd5d28bd8ff9719601e6a
Diffstat (limited to 'tests/malloc_iterate_test.cpp')
-rw-r--r--tests/malloc_iterate_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/malloc_iterate_test.cpp b/tests/malloc_iterate_test.cpp
index 87ec942f8..6a82eb699 100644
--- a/tests/malloc_iterate_test.cpp
+++ b/tests/malloc_iterate_test.cpp
@@ -94,9 +94,9 @@ static void SavePointers(uintptr_t base, size_t size, void* data) {
static void VerifyPtrs(TestDataType* test_data) {
test_data->total_allocated_bytes = 0;
- // Find all of the maps that are [anon:libc_malloc].
+ // Find all of the maps that are from the native allocator.
auto callback = [&](uint64_t start, uint64_t end, uint16_t, uint64_t, ino_t, const char* name) {
- if (strcmp(name, "[anon:libc_malloc]") == 0) {
+ if (strcmp(name, "[anon:libc_malloc]") == 0 || strncmp(name, "[anon:scudo:", 12) == 0) {
malloc_iterate(start, end - start, SavePointers, test_data);
}
};
@@ -192,7 +192,7 @@ TEST(malloc_iterate, invalid_pointers) {
// Only attempt to get memory data for maps that are not from the native allocator.
auto callback = [&](uint64_t start, uint64_t end, uint16_t, uint64_t, ino_t, const char* name) {
- if (strcmp(name, "[anon:libc_malloc]") != 0) {
+ if (strcmp(name, "[anon:libc_malloc]") != 0 && strncmp(name, "[anon:scudo:", 12) != 0) {
size_t total = test_data.total_allocated_bytes;
malloc_iterate(start, end - start, SavePointers, &test_data);
total = test_data.total_allocated_bytes - total;