diff --git a/Info.hpp b/Info.hpp index 7443c1e..47156ca 100644 --- a/Info.hpp +++ b/Info.hpp @@ -1,13 +1,18 @@ #include #include #include -#include + +#ifdef __linux__ + #include +#endif namespace Columbus { int GetCPUCount(); int GetCPUCacheSize(); + unsigned long GetRAMSize(); + unsigned long GetRamAvaliable(); int GetCPUCount() { @@ -52,6 +57,15 @@ namespace Columbus #endif } + unsigned long GetRAMSize() + { + #ifdef __linux__ + struct sysinfo info; + if (sysinfo(&info) == -1) return 0; + return info.totalram; + #endif + } + }