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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Return the number of logical processors/cores on the current machine. | 21 // Return the number of logical processors/cores on the current machine. |
22 static int NumberOfProcessors(); | 22 static int NumberOfProcessors(); |
23 | 23 |
24 // Return the number of bytes of physical memory on the current machine. | 24 // Return the number of bytes of physical memory on the current machine. |
25 static int64 AmountOfPhysicalMemory(); | 25 static int64 AmountOfPhysicalMemory(); |
26 | 26 |
27 // Return the number of bytes of current available physical memory on the | 27 // Return the number of bytes of current available physical memory on the |
28 // machine. | 28 // machine. |
29 static int64 AmountOfAvailablePhysicalMemory(); | 29 static int64 AmountOfAvailablePhysicalMemory(); |
30 | 30 |
| 31 // Return the number of bytes of virtual memory of this process. A return |
| 32 // value of zero means that there is no limit on the available virtual |
| 33 // memory. |
| 34 static int64 AmountOfVirtualMemory(); |
| 35 |
31 // Return the number of megabytes of physical memory on the current machine. | 36 // Return the number of megabytes of physical memory on the current machine. |
32 static int AmountOfPhysicalMemoryMB() { | 37 static int AmountOfPhysicalMemoryMB() { |
33 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); | 38 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); |
34 } | 39 } |
35 | 40 |
| 41 // Return the number of megabytes of available virtual memory, or zero if it |
| 42 // is unlimited. |
| 43 static int AmountOfVirtualMemoryMB() { |
| 44 return static_cast<int>(AmountOfVirtualMemory() / 1024 / 1024); |
| 45 } |
| 46 |
36 // Return the available disk space in bytes on the volume containing |path|, | 47 // Return the available disk space in bytes on the volume containing |path|, |
37 // or -1 on failure. | 48 // or -1 on failure. |
38 static int64 AmountOfFreeDiskSpace(const FilePath& path); | 49 static int64 AmountOfFreeDiskSpace(const FilePath& path); |
39 | 50 |
40 // Returns system uptime in milliseconds. | 51 // Returns system uptime in milliseconds. |
41 static int64 Uptime(); | 52 static int64 Uptime(); |
42 | 53 |
43 // Returns the name of the host operating system. | 54 // Returns the name of the host operating system. |
44 static std::string OperatingSystemName(); | 55 static std::string OperatingSystemName(); |
45 | 56 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 static std::string GetDeviceName(); | 127 static std::string GetDeviceName(); |
117 | 128 |
118 static int DalvikHeapSizeMB(); | 129 static int DalvikHeapSizeMB(); |
119 static int DalvikHeapGrowthLimitMB(); | 130 static int DalvikHeapGrowthLimitMB(); |
120 #endif // defined(OS_ANDROID) | 131 #endif // defined(OS_ANDROID) |
121 }; | 132 }; |
122 | 133 |
123 } // namespace base | 134 } // namespace base |
124 | 135 |
125 #endif // BASE_SYS_INFO_H_ | 136 #endif // BASE_SYS_INFO_H_ |
OLD | NEW |