Getting Free RAM Size

master
ColumbusTech 2017-11-24 21:54:59 +03:00
parent e0105a0902
commit 26fc862bdb
1 changed files with 10 additions and 1 deletions

View File

@ -12,7 +12,7 @@ namespace Columbus
int GetCPUCount();
int GetCPUCacheSize();
unsigned long GetRAMSize();
unsigned long GetRamAvaliable();
unsigned long GetRAMFree();
int GetCPUCount()
{
@ -66,6 +66,15 @@ namespace Columbus
#endif
}
unsigned long GetRAMFree()
{
#ifdef __linux__
struct sysinfo info;
if (sysinfo(&info) == -1) return 0;
return info.freeram;
#endif
}
}