| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_SYS_INFO_H_ | 5 #ifndef BASE_SYS_INFO_H_ |
| 6 #define BASE_SYS_INFO_H_ | 6 #define BASE_SYS_INFO_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class BASE_EXPORT SysInfo { | 21 class BASE_EXPORT SysInfo { |
| 22 public: | 22 public: |
| 23 // Return the number of logical processors/cores on the current machine. | 23 // Return the number of logical processors/cores on the current machine. |
| 24 static int NumberOfProcessors(); | 24 static int NumberOfProcessors(); |
| 25 | 25 |
| 26 // Return the number of bytes of physical memory on the current machine. | 26 // Return the number of bytes of physical memory on the current machine. |
| 27 static int64_t AmountOfPhysicalMemory(); | 27 static int64_t AmountOfPhysicalMemory(); |
| 28 | 28 |
| 29 // Return the number of bytes of current available physical memory on the | 29 // Return the number of bytes of current available physical memory on the |
| 30 // machine. | 30 // machine. |
| 31 // (The amount of memory that can be allocated without any significant |
| 32 // impact on the system. It can lead to freeing inactive file-backed |
| 33 // and/or speculative file-backed memory). |
| 31 static int64_t AmountOfAvailablePhysicalMemory(); | 34 static int64_t AmountOfAvailablePhysicalMemory(); |
| 32 | 35 |
| 33 // Return the number of bytes of virtual memory of this process. A return | 36 // Return the number of bytes of virtual memory of this process. A return |
| 34 // value of zero means that there is no limit on the available virtual | 37 // value of zero means that there is no limit on the available virtual |
| 35 // memory. | 38 // memory. |
| 36 static int64_t AmountOfVirtualMemory(); | 39 static int64_t AmountOfVirtualMemory(); |
| 37 | 40 |
| 38 // Return the number of megabytes of physical memory on the current machine. | 41 // Return the number of megabytes of physical memory on the current machine. |
| 39 static int AmountOfPhysicalMemoryMB() { | 42 static int AmountOfPhysicalMemoryMB() { |
| 40 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); | 43 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 148 |
| 146 // Returns true if this is a low-end device. | 149 // Returns true if this is a low-end device. |
| 147 // Low-end device refers to devices having less than 512M memory in the | 150 // Low-end device refers to devices having less than 512M memory in the |
| 148 // current implementation. | 151 // current implementation. |
| 149 static bool IsLowEndDevice(); | 152 static bool IsLowEndDevice(); |
| 150 }; | 153 }; |
| 151 | 154 |
| 152 } // namespace base | 155 } // namespace base |
| 153 | 156 |
| 154 #endif // BASE_SYS_INFO_H_ | 157 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |