summaryrefslogtreecommitdiff
path: root/Source/Core/Common/MemoryUtil.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-12-02 13:17:27 -0500
committerLioncash <mathew1800@gmail.com>2020-12-02 13:38:33 -0500
commit139d4fc76e4ddf45179ca5ec5e42c52ef513ea4d (patch)
treea639ad5dfd8a1b85eb32d408e2068dce9f41ce00 /Source/Core/Common/MemoryUtil.cpp
parent5abae61a8c7e0e4ac03bb8d3031793037e87fdd3 (diff)
General: Convert PanicAlerts over to fmt equivalent
Converts lingering panic alert calls over to the fmt-capable ones.
Diffstat (limited to 'Source/Core/Common/MemoryUtil.cpp')
-rw-r--r--Source/Core/Common/MemoryUtil.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp
index 909c12fa90..ca9fa64185 100644
--- a/Source/Core/Common/MemoryUtil.cpp
+++ b/Source/Core/Common/MemoryUtil.cpp
@@ -46,7 +46,7 @@ void* AllocateExecutableMemory(size_t size)
#endif
if (ptr == nullptr)
- PanicAlert("Failed to allocate executable memory");
+ PanicAlertFmt("Failed to allocate executable memory");
return ptr;
}
@@ -63,7 +63,7 @@ void* AllocateMemoryPages(size_t size)
#endif
if (ptr == nullptr)
- PanicAlert("Failed to allocate raw memory");
+ PanicAlertFmt("Failed to allocate raw memory");
return ptr;
}
@@ -79,7 +79,7 @@ void* AllocateAlignedMemory(size_t size, size_t alignment)
#endif
if (ptr == nullptr)
- PanicAlert("Failed to allocate aligned memory");
+ PanicAlertFmt("Failed to allocate aligned memory");
return ptr;
}
@@ -90,10 +90,10 @@ void FreeMemoryPages(void* ptr, size_t size)
{
#ifdef _WIN32
if (!VirtualFree(ptr, 0, MEM_RELEASE))
- PanicAlert("FreeMemoryPages failed!\nVirtualFree: %s", GetLastErrorString().c_str());
+ PanicAlertFmt("FreeMemoryPages failed!\nVirtualFree: {}", GetLastErrorString());
#else
if (munmap(ptr, size) != 0)
- PanicAlert("FreeMemoryPages failed!\nmunmap: %s", LastStrerrorString().c_str());
+ PanicAlertFmt("FreeMemoryPages failed!\nmunmap: {}", LastStrerrorString());
#endif
}
}
@@ -115,10 +115,10 @@ void ReadProtectMemory(void* ptr, size_t size)
#ifdef _WIN32
DWORD oldValue;
if (!VirtualProtect(ptr, size, PAGE_NOACCESS, &oldValue))
- PanicAlert("ReadProtectMemory failed!\nVirtualProtect: %s", GetLastErrorString().c_str());
+ PanicAlertFmt("ReadProtectMemory failed!\nVirtualProtect: {}", GetLastErrorString());
#else
if (mprotect(ptr, size, PROT_NONE) != 0)
- PanicAlert("ReadProtectMemory failed!\nmprotect: %s", LastStrerrorString().c_str());
+ PanicAlertFmt("ReadProtectMemory failed!\nmprotect: {}", LastStrerrorString());
#endif
}
@@ -127,10 +127,10 @@ void WriteProtectMemory(void* ptr, size_t size, bool allowExecute)
#ifdef _WIN32
DWORD oldValue;
if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READ : PAGE_READONLY, &oldValue))
- PanicAlert("WriteProtectMemory failed!\nVirtualProtect: %s", GetLastErrorString().c_str());
+ PanicAlertFmt("WriteProtectMemory failed!\nVirtualProtect: {}", GetLastErrorString());
#else
if (mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_EXEC) : PROT_READ) != 0)
- PanicAlert("WriteProtectMemory failed!\nmprotect: %s", LastStrerrorString().c_str());
+ PanicAlertFmt("WriteProtectMemory failed!\nmprotect: {}", LastStrerrorString());
#endif
}
@@ -139,12 +139,12 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute)
#ifdef _WIN32
DWORD oldValue;
if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &oldValue))
- PanicAlert("UnWriteProtectMemory failed!\nVirtualProtect: %s", GetLastErrorString().c_str());
+ PanicAlertFmt("UnWriteProtectMemory failed!\nVirtualProtect: {}", GetLastErrorString());
#else
if (mprotect(ptr, size,
allowExecute ? (PROT_READ | PROT_WRITE | PROT_EXEC) : PROT_WRITE | PROT_READ) != 0)
{
- PanicAlert("UnWriteProtectMemory failed!\nmprotect: %s", LastStrerrorString().c_str());
+ PanicAlertFmt("UnWriteProtectMemory failed!\nmprotect: {}", LastStrerrorString());
}
#endif
}