MCPcopy Create free account
hub / github.com/Kitware/CMake / QueryHPUXMemory

Method QueryHPUXMemory

Source/kwsys/SystemInformation.cxx:5235–5267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5233}
5234
5235bool SystemInformationImplementation::QueryHPUXMemory()
5236{
5237#if defined(__hpux)
5238 unsigned long tv = 0;
5239 unsigned long tp = 0;
5240 unsigned long av = 0;
5241 unsigned long ap = 0;
5242 struct pst_static pst;
5243 struct pst_dynamic pdy;
5244
5245 unsigned long ps = 0;
5246 if (pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) {
5247 return false;
5248 }
5249
5250 ps = pst.page_size;
5251 tp = pst.physical_memory * ps;
5252 tv = (pst.physical_memory + pst.pst_maxmem) * ps;
5253 if (pstat_getdynamic(&pdy, sizeof(pdy), (size_t)1, 0) == -1) {
5254 return false;
5255 }
5256
5257 ap = tp - pdy.psd_rm * ps;
5258 av = tv - pdy.psd_vm;
5259 this->TotalVirtualMemory = tv >> 10 >> 10;
5260 this->TotalPhysicalMemory = tp >> 10 >> 10;
5261 this->AvailableVirtualMemory = av >> 10 >> 10;
5262 this->AvailablePhysicalMemory = ap >> 10 >> 10;
5263 return true;
5264#else
5265 return false;
5266#endif
5267}
5268
5269bool SystemInformationImplementation::QueryHPUXProcessor()
5270{

Callers 1

RunMemoryCheckMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected