Getting Free RAM Size
parent
e0105a0902
commit
26fc862bdb
11
Info.hpp
11
Info.hpp
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue