diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-05-11 01:51:43 +0200 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-05-19 18:53:08 +0200 |
| commit | 8342164dbdf6d862556de017f67ff28ecde0f0ec (patch) | |
| tree | 1e8754c5f0667cbcf2268ab305e725166acfccca /Source/Core/Common/MemArenaAndroid.cpp | |
| parent | ff5bcba966372d5071c080234866e5fab23ae647 (diff) | |
Common/MemArena: Pass shared memory base file name to GrabSHMSegment().
Diffstat (limited to 'Source/Core/Common/MemArenaAndroid.cpp')
| -rw-r--r-- | Source/Core/Common/MemArenaAndroid.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/Common/MemArenaAndroid.cpp b/Source/Core/Common/MemArenaAndroid.cpp index 721925d213..01b210100a 100644 --- a/Source/Core/Common/MemArenaAndroid.cpp +++ b/Source/Core/Common/MemArenaAndroid.cpp @@ -10,6 +10,8 @@ #include <set> #include <string> +#include <fmt/format.h> + #include <dlfcn.h> #include <fcntl.h> #include <linux/ashmem.h> @@ -62,9 +64,10 @@ static int AshmemCreateFileMapping(const char* name, size_t size) MemArena::MemArena() = default; MemArena::~MemArena() = default; -void MemArena::GrabSHMSegment(size_t size) +void MemArena::GrabSHMSegment(size_t size, std::string_view base_name) { - m_shm_fd = AshmemCreateFileMapping(("dolphin-emu." + std::to_string(getpid())).c_str(), size); + const std::string name = fmt::format("{}.{}", base_name, getpid()); + m_shm_fd = AshmemCreateFileMapping(name.c_str(), size); if (m_shm_fd < 0) NOTICE_LOG_FMT(MEMMAP, "Ashmem allocation failed"); } |
