sysinfo: add win32 memory reporting
This commit is contained in:
parent
e73d42e817
commit
3b5ec78513
@ -57,5 +57,15 @@ cruft::util::operator<< (std::ostream &os, sysinfo const &)
|
||||
os << ", username: " << name;
|
||||
}
|
||||
|
||||
{
|
||||
MEMORYSTATUSEX status {};
|
||||
status.dwLength = sizeof (status);
|
||||
|
||||
if (!GlobalMemoryStatusEx (&status))
|
||||
win32::error::throw_code ();
|
||||
|
||||
os << ", ram: { total: " << status.ullTotalPhys << ", available: " << status.ullAvailPhys << " },";
|
||||
};
|
||||
|
||||
return os << " }";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user