Remove the leading '/' in jit zygote memfd/ashmem names.
This avoids having two '/' in case the jit zygote code cache
is using ashmem.
Test: cat /proc/pid/smaps
Change-Id: Ibff035949c3ff12ab513be75078255b804eef7a5
diff --git a/runtime/jit/jit_memory_region.cc b/runtime/jit/jit_memory_region.cc
index 12e5d54..43ef08e 100644
--- a/runtime/jit/jit_memory_region.cc
+++ b/runtime/jit/jit_memory_region.cc
@@ -73,7 +73,7 @@
}
} else {
// Bionic supports memfd_create, but the call may fail on older kernels.
- mem_fd = unique_fd(art::memfd_create("/jit-cache", /* flags= */ 0));
+ mem_fd = unique_fd(art::memfd_create("jit-cache", /* flags= */ 0));
if (mem_fd.get() < 0) {
std::ostringstream oss;
oss << "Failed to initialize dual view JIT. memfd_create() error: " << strerror(errno);
@@ -505,7 +505,7 @@
return -1;
}
/* Check if kernel support exists, otherwise fall back to ashmem */
- static const char* kRegionName = "/jit-zygote-cache";
+ static const char* kRegionName = "jit-zygote-cache";
if (art::IsSealFutureWriteSupported()) {
int fd = art::memfd_create(kRegionName, MFD_ALLOW_SEALING);
if (fd == -1) {