* @brief Implementation of @c getTotalSystemMemory() on *BSD. * * AKA FreeBSD, DragonFly, NetBSD, OpenBSD, TrueOS, PCBSD */
| 141 | * AKA FreeBSD, DragonFly, NetBSD, OpenBSD, TrueOS, PCBSD |
| 142 | */ |
| 143 | std::size_t getTotalSystemMemoryOnBSD() { |
| 144 | int what[] = { CTL_HW, HW_PHYSMEM }; |
| 145 | std::size_t value = 0; |
| 146 | std::size_t length = sizeof(value); |
| 147 | auto rc = sysctl(what, 2, &value, &length, nullptr, 0); |
| 148 | return rc != -1 ? value : 0; |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * @brief Implementation of @c limitSystemMemory() on *BSD. |
no outgoing calls
no test coverage detected