diff options
| author | Christopher Ferris <cferris@google.com> | 2019-07-08 14:54:58 -0700 |
|---|---|---|
| committer | Christopher Ferris <cferris@google.com> | 2019-07-08 15:15:01 -0700 |
| commit | 3d0bafb945bc9e39ddc84a0167e713b8e70dc135 (patch) | |
| tree | 9a5a3fa2e79b7220dc7203d908002970e8eb7455 /libc/bionic/jemalloc_wrapper.cpp | |
| parent | 7b85fb0d393c3119501779176b532b37182b0584 (diff) | |
Do not check tcache clear when doing a purge.
On systems where the tcache is disabled, the tcache clear option will
fail, and not really do a purge.
Bug: 137037462
Bug: 136236080
Test: Built taimen as malloc svelte and verified the M_PURGE mallopt
Test: call failed before this fix and passes afterwards.
Change-Id: Ib30e5f3e083a9c6d046adff30f2aa7eacaf6df10
Diffstat (limited to 'libc/bionic/jemalloc_wrapper.cpp')
| -rw-r--r-- | libc/bionic/jemalloc_wrapper.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp index bf0494dde..7d0445784 100644 --- a/libc/bionic/jemalloc_wrapper.cpp +++ b/libc/bionic/jemalloc_wrapper.cpp @@ -107,9 +107,8 @@ int je_mallopt(int param, int value) { // clear the caches of other threads. // This must be done first so that cleared allocations get purged // in the next calls. - if (je_mallctl("thread.tcache.flush", nullptr, nullptr, nullptr, 0) != 0) { - return 0; - } + // Ignore the return call since this will fail if the tcache is disabled. + je_mallctl("thread.tcache.flush", nullptr, nullptr, nullptr, 0); unsigned narenas; size_t sz = sizeof(unsigned); |
