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

Method QueryBSDMemory

Source/kwsys/SystemInformation.cxx:5088–5111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5086}
5087
5088bool SystemInformationImplementation::QueryBSDMemory()
5089{
5090#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
5091 defined(__DragonFly__)
5092 int ctrl[2] = { CTL_HW, HW_PHYSMEM };
5093# if defined(HW_PHYSMEM64)
5094 int64_t k;
5095 ctrl[1] = HW_PHYSMEM64;
5096# else
5097 int k;
5098# endif
5099 size_t sz = sizeof(k);
5100
5101 if (sysctl(ctrl, 2, &k, &sz, nullptr, 0) != 0) {
5102 return false;
5103 }
5104
5105 this->TotalPhysicalMemory = k >> 10 >> 10;
5106
5107 return true;
5108#else
5109 return false;
5110#endif
5111}
5112
5113bool SystemInformationImplementation::QueryQNXProcessor()
5114{

Callers 1

RunMemoryCheckMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected