Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

bionic: Commit

bionic


Commit MetaInfo

Révision5cda74e065761bbeccf7ff61d7a3131bdf6490d0 (tree)
l'heure2019-07-09 11:16:31
AuteurChristopher Ferris <cferris@goog...>
CommiterChristopher Ferris

Message de Log

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)

Change Summary

Modification

--- a/libc/bionic/jemalloc_wrapper.cpp
+++ b/libc/bionic/jemalloc_wrapper.cpp
@@ -107,9 +107,8 @@ int je_mallopt(int param, int value) {
107107 // clear the caches of other threads.
108108 // This must be done first so that cleared allocations get purged
109109 // in the next calls.
110- if (je_mallctl("thread.tcache.flush", nullptr, nullptr, nullptr, 0) != 0) {
111- return 0;
112- }
110+ // Ignore the return call since this will fail if the tcache is disabled.
111+ je_mallctl("thread.tcache.flush", nullptr, nullptr, nullptr, 0);
113112
114113 unsigned narenas;
115114 size_t sz = sizeof(unsigned);
Afficher sur ancien navigateur de dépôt.