aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2021-02-09 22:19:44 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2021-02-09 22:19:44 +0100
commite7ee3b7bc84e583fbfbe7c9896db53d3e808edcc (patch)
tree6d6b9a9ba9e91f02d575bc8edbb23c786a04b7d4 /src
parent6256a42e0099cef9f567148083c55bbb798d8184 (diff)
wild shot into the dark
Diffstat (limited to 'src')
-rw-r--r--src/ARMJIT_Memory.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/ARMJIT_Memory.cpp b/src/ARMJIT_Memory.cpp
index 2ff38f9..5a011f3 100644
--- a/src/ARMJIT_Memory.cpp
+++ b/src/ARMJIT_Memory.cpp
@@ -711,16 +711,11 @@ void Init()
MemoryFile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, MemoryTotalSize, NULL);
- MemoryBase = (u8*)VirtualAlloc(NULL, MemoryTotalSize, MEM_RESERVE, PAGE_READWRITE);
-
- FastMem9Start = VirtualAlloc(NULL, AddrSpaceSize, MEM_RESERVE, PAGE_READWRITE);
- FastMem7Start = VirtualAlloc(NULL, AddrSpaceSize, MEM_RESERVE, PAGE_READWRITE);
-
- // only free them after they have all been reserved
- // so they can't overlap
+ MemoryBase = (u8*)VirtualAlloc(NULL, AddrSpaceSize*4, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(MemoryBase, 0, MEM_RELEASE);
- VirtualFree(FastMem9Start, 0, MEM_RELEASE);
- VirtualFree(FastMem7Start, 0, MEM_RELEASE);
+ FastMem9Start = MemoryBase;
+ FastMem7Start = MemoryBase + AddrSpaceSize;
+ MemoryBase = MemoryBase + AddrSpaceSize*2;
MapViewOfFileEx(MemoryFile, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, MemoryTotalSize, MemoryBase);