MCPcopy Create free account
hub / github.com/avast/retdec / getTotalSystemMemoryOnMacOS

Function getTotalSystemMemoryOnMacOS

src/utils/memory.cpp:106–112  ·  view source on GitHub ↗

* @brief Implementation of @c getTotalSystemMemory() on MacOS. */

Source from the content-addressed store, hash-verified

104* @brief Implementation of @c getTotalSystemMemory() on MacOS.
105*/
106std::size_t getTotalSystemMemoryOnMacOS() {
107 int what[] = { CTL_HW, HW_MEMSIZE };
108 std::size_t value = 0;
109 std::size_t length = sizeof(value);
110 auto rc = sysctl(what, 2, &value, &length, nullptr, 0);
111 return rc != -1 ? value : 0;
112}
113
114/**
115* @brief Implementation of @c limitSystemMemory() on MacOS.

Callers 1

getTotalSystemMemoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected