diff options
author | Edgar Arriaga <edgararriaga@google.com> | 2020-11-23 18:11:02 -0800 |
---|---|---|
committer | Edgar Arriaga <edgararriaga@google.com> | 2021-01-14 19:34:39 -0800 |
commit | d02148c31af0025582c633cc3dac177022d6da56 (patch) | |
tree | b92a7e724664b8e6ce725c62e65e5e18f09b243e /tests/malloc_iterate_test.cpp | |
parent | e925485acdfdbef0894bf26e1d0595002b83c696 (diff) |
Add a flag to distinguish shared VMAs
This flag is required to filter out shared VMAs when compacting memory
using process_madvise.
Test: atest bionic-unit-tests-static
Bug: 173258203
Change-Id: I01fc0cc614b03128a5a9b0a6c8c5c2d829b701f9
Diffstat (limited to 'tests/malloc_iterate_test.cpp')
-rw-r--r-- | tests/malloc_iterate_test.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/malloc_iterate_test.cpp b/tests/malloc_iterate_test.cpp index 738a57b2b..e896c90f4 100644 --- a/tests/malloc_iterate_test.cpp +++ b/tests/malloc_iterate_test.cpp @@ -95,7 +95,8 @@ static void VerifyPtrs(TestDataType* test_data) { test_data->total_allocated_bytes = 0; // 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) { + auto callback = [&](uint64_t start, uint64_t end, uint16_t, uint64_t, ino_t, const char* name, + bool) { if (strcmp(name, "[anon:libc_malloc]") == 0 || strncmp(name, "[anon:scudo:", 12) == 0 || strncmp(name, "[anon:GWP-ASan", 14) == 0) { malloc_iterate(start, end - start, SavePointers, test_data); @@ -192,7 +193,8 @@ TEST(malloc_iterate, invalid_pointers) { TestDataType test_data = {}; // 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) { + auto callback = [&](uint64_t start, uint64_t end, uint16_t, uint64_t, ino_t, const char* name, + bool) { if (strcmp(name, "[anon:libc_malloc]") != 0 && strncmp(name, "[anon:scudo:", 12) != 0 && strncmp(name, "[anon:GWP-ASan", 14) != 0) { size_t total = test_data.total_allocated_bytes; |