Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f764ecf7 authored by Mitch Phillips's avatar Mitch Phillips Committed by Automerger Merge Worker
Browse files

Merge "[MemInit] Use new MemInit API." am: 8a956c5f am: cad354ec am: 93939f0a am: f12d6090

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1555544

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I635039c73c9fe55916ee50b677802fe3cf64d1e9
parents 6fb28746 f12d6090
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@
#include <bionic/malloc.h>
#include <bionic/mte.h>
#include <cutils/fs.h>
#include <cutils/memory.h>
#include <cutils/multiuser.h>
#include <cutils/sockets.h>
#include <private/android_filesystem_config.h>
@@ -621,13 +620,6 @@ static void PreApplicationInit() {

  // Set the jemalloc decay time to 1.
  mallopt(M_DECAY_TIME, 1);

  // Avoid potentially expensive memory mitigations, mostly meant for system
  // processes, in apps. These may cause app compat problems, use more memory,
  // or reduce performance. While it would be nice to have them for apps,
  // we will have to wait until they are proven out, have more efficient
  // hardware, and/or apply them only to new applications.
  process_disable_memory_mitigations();
}

static void SetUpSeccompFilter(uid_t uid, bool is_child_zygote) {
@@ -1785,6 +1777,14 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
      break;
  }
  mallopt(M_BIONIC_SET_HEAP_TAGGING_LEVEL, heap_tagging_level);

  // Avoid heap zero initialization for applications without MTE. Zero init may
  // cause app compat problems, use more memory, or reduce performance. While it
  // would be nice to have them for apps, we will have to wait until they are
  // proven out, have more efficient hardware, and/or apply them only to new
  // applications.
  mallopt(M_BIONIC_ZERO_INIT, 0);

  // Now that we've used the flag, clear it so that we don't pass unknown flags to the ART runtime.
  runtime_flags &= ~RuntimeFlags::MEMORY_TAG_LEVEL_MASK;