diff --git a/Info.hpp b/Info.hpp index ff4953b..67c1fe9 100644 --- a/Info.hpp +++ b/Info.hpp @@ -142,7 +142,7 @@ namespace Columbus #ifdef __linux__ struct sysinfo info; if (sysinfo(&info) == -1) return 0; - return info.totalram; + return info.totalram / (1024 * 1024); #endif #ifdef COLUMBUS_PLATFORM_WINDOWS @@ -160,7 +160,7 @@ namespace Columbus #ifdef __linux__ struct sysinfo info; if (sysinfo(&info) == -1) return 0; - return info.freeram; + return info.freeram / (1024 * 1024); #endif #ifdef COLUMBUS_PLATFORM_WINDOWS @@ -186,6 +186,13 @@ namespace Columbus int GetRAMUsage() { + #ifdef __linux__ + struct sysinfo info; + if (sysinfo(&info) == -1) return 0; + float usage = static_cast(GetRAMFree()) / static_cast(GetRAMSize()); + return static_cast(100 - usage * 100); + #endif + #ifdef COLUMBUS_PLATFORM_WINDOWS MEMORYSTATUSEX memInfo; memInfo.dwLength = sizeof(memInfo);