Skip to content

Commit

Permalink
Common: Add MemArena.h/cpp to the Common namespace
Browse files Browse the repository at this point in the history
Brings more common code under the Common namespace.
  • Loading branch information
lioncash committed May 15, 2018
1 parent 51ce30e commit 947fa27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Source/Core/Common/MemArena.cpp
Expand Up @@ -28,6 +28,8 @@
#endif
#endif

namespace Common
{
#ifdef ANDROID
#define ASHMEM_DEVICE "/dev/ashmem"

Expand Down Expand Up @@ -154,3 +156,5 @@ u8* MemArena::FindMemoryBase()
return static_cast<u8*>(base);
#endif
}

} // namespace Common
5 changes: 4 additions & 1 deletion Source/Core/Common/MemArena.h
Expand Up @@ -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:
Expand All @@ -35,3 +36,5 @@ class MemArena
int fd;
#endif
};

} // namespace Common
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/Memmap.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 947fa27

Please sign in to comment.