MemArena: Rename GrabLowMemSpace to GrabSHMSegment

This code originally tried to map the "low space" for the Gamecube's
memory layout, but since has expanded to mapping all of the easily
mappable memory on the system. Change the name to "GrabSHMSegment" to
indicate that we're looking for a shared memory segment we can map into
our process space.
This commit is contained in:
Jasper St. Pierre 2014-11-01 13:30:14 -07:00
parent 079b881d20
commit 1e93b0db19
3 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@ static int AshmemCreateFileMapping(const char *name, size_t size)
}
#endif
void MemArena::GrabLowMemSpace(size_t size)
void MemArena::GrabSHMSegment(size_t size)
{
#ifdef _WIN32
hMemoryMapping = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, (DWORD)(size), nullptr);
@ -82,7 +82,7 @@ void MemArena::GrabLowMemSpace(size_t size)
}
void MemArena::ReleaseSpace()
void MemArena::ReleaseSHMSegment()
{
#ifdef _WIN32
CloseHandle(hMemoryMapping);
@ -244,8 +244,8 @@ u8 *MemoryMap_Setup(MemoryView *views, int num_views, u32 flags, MemArena *arena
if ((views[i].flags & MV_MIRROR_PREVIOUS) == 0)
total_mem += views[i].size;
}
// Grab some pagefile backed memory out of the void ...
arena->GrabLowMemSpace(total_mem);
arena->GrabSHMSegment(total_mem);
// Now, create views in high memory where there's plenty of space.
u8 *base = MemArena::Find4GBBase();

View File

@ -19,8 +19,8 @@
class MemArena
{
public:
void GrabLowMemSpace(size_t size);
void ReleaseSpace();
void GrabSHMSegment(size_t size);
void ReleaseSHMSegment();
void *CreateView(s64 offset, size_t size, void *base = nullptr);
void ReleaseView(void *view, size_t size);

View File

@ -163,7 +163,7 @@ void Shutdown()
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) flags |= MV_WII_ONLY;
if (bFakeVMEM) flags |= MV_FAKE_VMEM;
MemoryMap_Shutdown(views, num_views, flags, &g_arena);
g_arena.ReleaseSpace();
g_arena.ReleaseSHMSegment();
base = nullptr;
delete mmio_mapping;
INFO_LOG(MEMMAP, "Memory system shut down.");