aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-07-08 14:54:58 -0700
committerChristopher Ferris <cferris@google.com>2019-07-08 19:16:31 -0700
commit5cda74e065761bbeccf7ff61d7a3131bdf6490d0 (patch)
treee060019567adf0d4f64d6e60fbe6f82a5b715af4
parentfe0fbcff7f70ecd6dc046902385ab06a73320e7c (diff)
downloadandroid_bionic-5cda74e065761bbeccf7ff61d7a3131bdf6490d0.tar.gz
android_bionic-5cda74e065761bbeccf7ff61d7a3131bdf6490d0.tar.bz2
android_bionic-5cda74e065761bbeccf7ff61d7a3131bdf6490d0.zip
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 Merged-In: Ib30e5f3e083a9c6d046adff30f2aa7eacaf6df10 (cherry picked from commit 3d0bafb945bc9e39ddc84a0167e713b8e70dc135)
-rw-r--r--libc/bionic/jemalloc_wrapper.cpp5
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);