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

Method QueryQNXMemory

Source/kwsys/SystemInformation.cxx:5055–5086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5053}
5054
5055bool SystemInformationImplementation::QueryQNXMemory()
5056{
5057#if defined(__QNX__)
5058 std::string buffer;
5059 std::vector<char const*> args;
5060 args.clear();
5061
5062 args.push_back("showmem");
5063 args.push_back("-S");
5064 args.push_back(0);
5065 buffer = this->RunProcess(args);
5066 args.clear();
5067
5068 size_t pos = buffer.find("System RAM:");
5069 if (pos == std::string::npos)
5070 return false;
5071 pos = buffer.find(":", pos);
5072 size_t pos2 = buffer.find("M (", pos);
5073 if (pos2 == std::string::npos)
5074 return false;
5075
5076 pos++;
5077 while (buffer[pos] == ' ')
5078 pos++;
5079
5080 buffer.erase(0, pos);
5081 buffer.resize(pos2);
5082 this->TotalPhysicalMemory = atoi(buffer.c_str());
5083 return true;
5084#endif
5085 return false;
5086}
5087
5088bool SystemInformationImplementation::QueryBSDMemory()
5089{

Callers 1

RunMemoryCheckMethod · 0.95

Calls 7

RunProcessMethod · 0.95
push_backMethod · 0.80
eraseMethod · 0.80
c_strMethod · 0.80
clearMethod · 0.45
findMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected