Common/MemArena: Pass shared memory base file name to GrabSHMSegment().

This commit is contained in:
Admiral H. Curtiss
2023-05-11 01:51:43 +02:00
parent ff5bcba966
commit 8342164dbd
5 changed files with 18 additions and 8 deletions

View File

@ -8,6 +8,8 @@
#include <cstdlib>
#include <string>
#include <fmt/format.h>
#include <windows.h>
#include "Common/Assert.h"
@ -107,9 +109,9 @@ static DWORD GetLowDWORD(u64 value)
return static_cast<DWORD>(value);
}
void MemArena::GrabSHMSegment(size_t size)
void MemArena::GrabSHMSegment(size_t size, std::string_view base_name)
{
const std::string name = "dolphin-emu." + std::to_string(GetCurrentProcessId());
const std::string name = fmt::format("{}.{}", base_name, GetCurrentProcessId());
m_memory_handle =
CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, GetHighDWORD(size),
GetLowDWORD(size), UTF8ToTStr(name).c_str());