diff options
author | Christopher Ferris <cferris@google.com> | 2017-05-15 15:50:19 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2017-05-15 16:59:16 -0700 |
commit | a1c0d2fd4ce96e123c4ae6506c9d637d747e1fe2 (patch) | |
tree | b1f89edbd67d6b09b9cbdfb1bf03b65b2dac9ad4 /tests/malloc_test.cpp | |
parent | ac58d33d343eba6a3370f541467f09802c48b24b (diff) |
Add support for modifying decay timer.
Add the mallopt function, and only a single option so far.
Bug: 36401135
Test: Built and booted bullhead.
Test: Ran jemalloc unit tests.
Test: Ran bionic unit tests.
Test: Ran a test that allocated and free'd a large piece of memory,
Test: and verified that after changing the parameter, the PSS
Test: sticks around (decay timer set to 1), the PSS is purged (decay
Test: timer set to 0).
Change-Id: I6927929b0c539c1023d34772d9e26bb6a8a45877
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r-- | tests/malloc_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp index 8fba1c449..a7b9d52e5 100644 --- a/tests/malloc_test.cpp +++ b/tests/malloc_test.cpp @@ -500,3 +500,10 @@ TEST(malloc, verify_alignment) { delete[] values_64; delete[] values_ldouble; } + +TEST(malloc, mallopt_smoke) { + errno = 0; + ASSERT_EQ(0, mallopt(-1000, 1)); + // mallopt doesn't set errno. + ASSERT_EQ(0, errno); +} |