diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-06-09 18:10:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-09 18:10:04 +0200 |
| commit | 1f30bd1f26feafeee2cfd32c43ef34bcec42d07f (patch) | |
| tree | 64f8f814de8f0b51a5b11a560387a318acb13c0a /Source/Core/Common/MemoryUtil.cpp | |
| parent | d9e8a2a7e7a40756a9197c07f2d951cbd4cc1cc0 (diff) | |
| parent | f206a4ea9c7e28d09676e1d29a4c32942c323cb6 (diff) | |
Merge pull request #5583 from shuffle2/remove-psapi
remove MemUsage, and therefor psapi dependency
Diffstat (limited to 'Source/Core/Common/MemoryUtil.cpp')
| -rw-r--r-- | Source/Core/Common/MemoryUtil.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index 305d779c3f..beb594302e 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -14,7 +14,6 @@ #ifdef _WIN32 #include <windows.h> -#include <psapi.h> #include "Common/StringUtil.h" #else #include <stdio.h> @@ -176,31 +175,6 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute) PanicAlert("UnWriteProtectMemory failed!\n%s", GetLastErrorMsg().c_str()); } -std::string MemUsage() -{ -#ifdef _WIN32 -#pragma comment(lib, "psapi") - DWORD processID = GetCurrentProcessId(); - HANDLE hProcess; - PROCESS_MEMORY_COUNTERS pmc; - std::string Ret; - - // Print information about the memory usage of the process. - - hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID); - if (nullptr == hProcess) - return "MemUsage Error"; - - if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc))) - Ret = StringFromFormat("%s K", ThousandSeparate(pmc.WorkingSetSize / 1024, 7).c_str()); - - CloseHandle(hProcess); - return Ret; -#else - return ""; -#endif -} - size_t MemPhysical() { #ifdef _WIN32 |
