mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
LLVM: Indirect call map
This commit is contained in:
parent
7a921cbdf9
commit
0ea0c21fed
6 changed files with 49 additions and 56 deletions
|
@ -25,21 +25,21 @@ namespace memory_helper
|
|||
return ret;
|
||||
}
|
||||
|
||||
void commit_page_memory(void* pointer, size_t page_size)
|
||||
void commit_page_memory(void* pointer, size_t size)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
VERIFY(VirtualAlloc((u8*)pointer, page_size, MEM_COMMIT, PAGE_READWRITE) != NULL);
|
||||
VERIFY(VirtualAlloc(pointer, size, MEM_COMMIT, PAGE_READWRITE) != NULL);
|
||||
#else
|
||||
VERIFY(mprotect((u8*)pointer, page_size, PROT_READ | PROT_WRITE) != -1);
|
||||
VERIFY(mprotect((void*)((u64)pointer & -4096), size, PROT_READ | PROT_WRITE) != -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void free_reserved_memory(void* pointer, size_t size)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
VERIFY(VirtualFree(pointer, 0, MEM_RELEASE) != 0);
|
||||
VERIFY(VirtualFree(pointer, 0, MEM_DECOMMIT) != 0);
|
||||
#else
|
||||
VERIFY(munmap(pointer, size) == 0);
|
||||
VERIFY(mprotect(pointer, size, PROT_NONE) != -1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue