mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 06:39:14 +01:00
Common: Add MemArena.h/cpp to the Common namespace
Brings more common code under the Common namespace.
This commit is contained in:
parent
51ce30e09d
commit
947fa271be
@ -28,6 +28,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace Common
|
||||||
|
{
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#define ASHMEM_DEVICE "/dev/ashmem"
|
#define ASHMEM_DEVICE "/dev/ashmem"
|
||||||
|
|
||||||
@ -154,3 +156,5 @@ u8* MemArena::FindMemoryBase()
|
|||||||
return static_cast<u8*>(base);
|
return static_cast<u8*>(base);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Common
|
||||||
|
@ -12,11 +12,12 @@
|
|||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
|
namespace Common
|
||||||
|
{
|
||||||
// This class lets you create a block of anonymous RAM, and then arbitrarily map views into it.
|
// 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
|
// Multiple views can mirror the same section of the block, which makes it very convenient for
|
||||||
// emulating
|
// emulating
|
||||||
// memory mirrors.
|
// memory mirrors.
|
||||||
|
|
||||||
class MemArena
|
class MemArena
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -35,3 +36,5 @@ private:
|
|||||||
int fd;
|
int fd;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Common
|
||||||
|
@ -44,7 +44,7 @@ u8* physical_base = nullptr;
|
|||||||
u8* logical_base = nullptr;
|
u8* logical_base = nullptr;
|
||||||
|
|
||||||
// The MemArena class
|
// The MemArena class
|
||||||
static MemArena g_arena;
|
static Common::MemArena g_arena;
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
// STATE_TO_SAVE
|
// STATE_TO_SAVE
|
||||||
@ -190,7 +190,7 @@ void Init()
|
|||||||
mem_size += region.size;
|
mem_size += region.size;
|
||||||
}
|
}
|
||||||
g_arena.GrabSHMSegment(mem_size);
|
g_arena.GrabSHMSegment(mem_size);
|
||||||
physical_base = MemArena::FindMemoryBase();
|
physical_base = Common::MemArena::FindMemoryBase();
|
||||||
|
|
||||||
for (PhysicalMemoryRegion& region : physical_regions)
|
for (PhysicalMemoryRegion& region : physical_regions)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user