From 947fa271bec7e512eddaf7e5d6ffecef49c88361 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 15 May 2018 17:28:41 -0400 Subject: [PATCH] Common: Add MemArena.h/cpp to the Common namespace Brings more common code under the Common namespace. --- Source/Core/Common/MemArena.cpp | 4 ++++ Source/Core/Common/MemArena.h | 5 ++++- Source/Core/Core/HW/Memmap.cpp | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp index 750a240e19cc..fcd18892baf5 100644 --- a/Source/Core/Common/MemArena.cpp +++ b/Source/Core/Common/MemArena.cpp @@ -28,6 +28,8 @@ #endif #endif +namespace Common +{ #ifdef ANDROID #define ASHMEM_DEVICE "/dev/ashmem" @@ -154,3 +156,5 @@ u8* MemArena::FindMemoryBase() return static_cast(base); #endif } + +} // namespace Common diff --git a/Source/Core/Common/MemArena.h b/Source/Core/Common/MemArena.h index 9018c061dd6e..21295ce6a537 100644 --- a/Source/Core/Common/MemArena.h +++ b/Source/Core/Common/MemArena.h @@ -12,11 +12,12 @@ #include "Common/CommonTypes.h" +namespace Common +{ // This class lets you create a block of anonymous RAM, and then arbitrarily map views into it. // Multiple views can mirror the same section of the block, which makes it very convenient for // emulating // memory mirrors. - class MemArena { public: @@ -35,3 +36,5 @@ class MemArena int fd; #endif }; + +} // namespace Common diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp index 804cee9cb1cb..493849c7f335 100644 --- a/Source/Core/Core/HW/Memmap.cpp +++ b/Source/Core/Core/HW/Memmap.cpp @@ -44,7 +44,7 @@ u8* physical_base = nullptr; u8* logical_base = nullptr; // The MemArena class -static MemArena g_arena; +static Common::MemArena g_arena; // ============== // STATE_TO_SAVE @@ -190,7 +190,7 @@ void Init() mem_size += region.size; } g_arena.GrabSHMSegment(mem_size); - physical_base = MemArena::FindMemoryBase(); + physical_base = Common::MemArena::FindMemoryBase(); for (PhysicalMemoryRegion& region : physical_regions) {