mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
Common: namespace MemoryUtil
This commit is contained in:
@ -48,7 +48,7 @@ public:
|
||||
void AllocCodeSpace(int size, bool need_low = true)
|
||||
{
|
||||
region_size = size;
|
||||
region = (u8*)AllocateExecutableMemory(region_size, need_low);
|
||||
region = static_cast<u8*>(Common::AllocateExecutableMemory(region_size, need_low));
|
||||
T::SetCodePtr(region);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
// Call this when shutting down. Don't rely on the destructor, even though it'll do the job.
|
||||
void FreeCodeSpace()
|
||||
{
|
||||
FreeMemoryPages(region, region_size);
|
||||
Common::FreeMemoryPages(region, region_size);
|
||||
region = nullptr;
|
||||
region_size = 0;
|
||||
parent_region_size = 0;
|
||||
@ -77,7 +77,7 @@ public:
|
||||
bool IsInSpace(u8* ptr) const { return (ptr >= region) && (ptr < (region + region_size)); }
|
||||
// Cannot currently be undone. Will write protect the entire code region.
|
||||
// Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()).
|
||||
void WriteProtect() { WriteProtectMemory(region, region_size, true); }
|
||||
void WriteProtect() { Common::WriteProtectMemory(region, region_size, true); }
|
||||
void ResetCodePtr() { T::SetCodePtr(region); }
|
||||
size_t GetSpaceLeft() const
|
||||
{
|
||||
|
Reference in New Issue
Block a user