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

Commit 7f3e096b authored by Hans Boehm's avatar Hans Boehm
Browse files

Don't MAP_POPULATE native ZygoteCommandBuffer

Since we made it significantly larger, populating it will often waste
a bit of space.

Belated follow-up to aosp/2009575 .

Test: Build and boot AOSP.
Bug: 219763513
Change-Id: I5fdbd379942e92df52c079e52e35ebbee0429577
parent 70c3d353
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ jlong com_android_internal_os_ZygoteCommandBuffer_getNativeBuffer(JNIEnv* env, j
  ++buffersAllocd;
  // MMap explicitly to get it page aligned.
  void *bufferMem = mmap(NULL, sizeof(NativeCommandBuffer), PROT_READ | PROT_WRITE,
                         MAP_ANONYMOUS | MAP_PRIVATE | MAP_POPULATE, -1, 0);
                         MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
  // Currently we mmap and unmap one for every request handled by the Java code.
  // That could be improved, but unclear it matters.
  if (bufferMem == MAP_FAILED) {