| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 memory = status.ullTotalPhys; | 172 memory = status.ullTotalPhys; |
| 173 } else { | 173 } else { |
| 174 LOG_GLE(LS_WARNING) << "GlobalMemoryStatusEx failed."; | 174 LOG_GLE(LS_WARNING) << "GlobalMemoryStatusEx failed."; |
| 175 } | 175 } |
| 176 | 176 |
| 177 #elif defined(WEBRTC_MAC) | 177 #elif defined(WEBRTC_MAC) |
| 178 size_t len = sizeof(memory); | 178 size_t len = sizeof(memory); |
| 179 int error = sysctlbyname("hw.memsize", &memory, &len, NULL, 0); | 179 int error = sysctlbyname("hw.memsize", &memory, &len, NULL, 0); |
| 180 if (error || memory == 0) | 180 if (error || memory == 0) |
| 181 memory = -1; | 181 memory = -1; |
| 182 #else // WEBRTC_LINUX | 182 #elif defined(WEBRTC_LINUX) |
| 183 memory = static_cast<int64>(sysconf(_SC_PHYS_PAGES)) * | 183 memory = static_cast<int64>(sysconf(_SC_PHYS_PAGES)) * |
| 184 static_cast<int64>(sysconf(_SC_PAGESIZE)); | 184 static_cast<int64>(sysconf(_SC_PAGESIZE)); |
| 185 if (memory < 0) { | 185 if (memory < 0) { |
| 186 LOG(LS_WARNING) << "sysconf(_SC_PHYS_PAGES) failed." | 186 LOG(LS_WARNING) << "sysconf(_SC_PHYS_PAGES) failed." |
| 187 << "sysconf(_SC_PHYS_PAGES) " << sysconf(_SC_PHYS_PAGES) | 187 << "sysconf(_SC_PHYS_PAGES) " << sysconf(_SC_PHYS_PAGES) |
| 188 << "sysconf(_SC_PAGESIZE) " << sysconf(_SC_PAGESIZE); | 188 << "sysconf(_SC_PAGESIZE) " << sysconf(_SC_PAGESIZE); |
| 189 memory = -1; | 189 memory = -1; |
| 190 } | 190 } |
| 191 #endif | 191 #endif |
| 192 | 192 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 204 int error = sysctlbyname("hw.model", buffer, &length, NULL, 0); | 204 int error = sysctlbyname("hw.model", buffer, &length, NULL, 0); |
| 205 if (!error) | 205 if (!error) |
| 206 return std::string(buffer, length - 1); | 206 return std::string(buffer, length - 1); |
| 207 return std::string(); | 207 return std::string(); |
| 208 #else | 208 #else |
| 209 return "Not available"; | 209 return "Not available"; |
| 210 #endif | 210 #endif |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace rtc | 213 } // namespace rtc |
| OLD | NEW |