diff --git a/UI/platform-windows.cpp b/UI/platform-windows.cpp index b3ee38d59..6675aa664 100644 --- a/UI/platform-windows.cpp +++ b/UI/platform-windows.cpp @@ -30,6 +30,7 @@ using namespace std; #include #include #include +#include #include #include @@ -259,3 +260,14 @@ bool DisableAudioDucking(bool disable) result = sessionControl2->SetDuckingPreference(disable); return SUCCEEDED(result); } + +uint64_t CurrentMemoryUsage() +{ + PROCESS_MEMORY_COUNTERS pmc = {}; + pmc.cb = sizeof(pmc); + + if (!GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) + return 0; + + return (uint64_t)pmc.WorkingSetSize; +} diff --git a/UI/platform.hpp b/UI/platform.hpp index 73ea999af..50efef300 100644 --- a/UI/platform.hpp +++ b/UI/platform.hpp @@ -43,6 +43,7 @@ void SetAeroEnabled(bool enable); void SetProcessPriority(const char *priority); void SetWin32DropStyle(QWidget *window); bool DisableAudioDucking(bool disable); +uint64_t CurrentMemoryUsage(); #endif #ifdef __APPLE__