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 3d0bafb945)
This commit is contained in:
Christopher Ferris 2019-07-08 14:54:58 -07:00
parent fe0fbcff7f
commit 5cda74e065

View file

@ -107,9 +107,8 @@ int je_mallopt(int param, int value) {
// clear the caches of other threads. // clear the caches of other threads.
// This must be done first so that cleared allocations get purged // This must be done first so that cleared allocations get purged
// in the next calls. // in the next calls.
if (je_mallctl("thread.tcache.flush", nullptr, nullptr, nullptr, 0) != 0) { // Ignore the return call since this will fail if the tcache is disabled.
return 0; je_mallctl("thread.tcache.flush", nullptr, nullptr, nullptr, 0);
}
unsigned narenas; unsigned narenas;
size_t sz = sizeof(unsigned); size_t sz = sizeof(unsigned);