* @brief Implementation of @c getTotalSystemMemory() on MacOS. */
| 104 | * @brief Implementation of @c getTotalSystemMemory() on MacOS. |
| 105 | */ |
| 106 | std::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. |
no outgoing calls
no test coverage detected