mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-25 03:35:59 +00:00
MemArena: Use placeholders on Windows.
This commit is contained in:
parent
09a0ba06c0
commit
79405de103
2 changed files with 368 additions and 19 deletions
|
@ -4,15 +4,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
#ifdef _WIN32
|
||||
struct WindowsMemoryRegion;
|
||||
#endif
|
||||
|
||||
// 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.
|
||||
|
@ -99,7 +100,15 @@ public:
|
|||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
HANDLE hMemoryMapping;
|
||||
WindowsMemoryRegion* EnsureSplitRegionForMapping(void* address, size_t size);
|
||||
bool JoinRegionsAfterUnmap(void* address, size_t size);
|
||||
|
||||
std::vector<WindowsMemoryRegion> m_regions;
|
||||
void* m_reserved_region = nullptr;
|
||||
void* m_memory_handle = nullptr;
|
||||
void* m_api_ms_win_core_memory_l1_1_6_handle = nullptr;
|
||||
void* m_address_VirtualAlloc2 = nullptr;
|
||||
void* m_address_MapViewOfFile3 = nullptr;
|
||||
#else
|
||||
int fd;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue