mirror of https://github.com/mgba-emu/mgba.git
Now that mapping is done through a different code path, we can properly allocate large memory chunks on Windows
This commit is contained in:
parent
0584c19229
commit
7bb5e29a98
|
@ -1,13 +1,13 @@
|
|||
#include "util/memory.h"
|
||||
|
||||
#include <io.h>
|
||||
#include <Windows.h>
|
||||
|
||||
void* anonymousMemoryMap(size_t size) {
|
||||
HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size & 0xFFFFFFFF, 0);
|
||||
return MapViewOfFile(hMap, FILE_MAP_WRITE, 0, 0, size);
|
||||
return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
||||
}
|
||||
|
||||
void mappedMemoryFree(void* memory, size_t size) {
|
||||
// TODO fill in
|
||||
UNUSED(size);
|
||||
// size is not useful here because we're freeing the memory, not decommitting it
|
||||
VirtualFree(memory, 0, MEM_RELEASE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue