OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/sys_info.h" | 5 #include "base/sys_info.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/lazy_instance.h" | |
darin (slow to review)
2012/05/24 22:27:43
nit: no longer need this include
ulan
2012/05/25 14:14:36
Done.
| |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 | 15 |
15 int64 SysInfo::AmountOfPhysicalMemory() { | 16 int64 SysInfo::AmountOfPhysicalMemory() { |
16 long pages = sysconf(_SC_PHYS_PAGES); | 17 long pages = sysconf(_SC_PHYS_PAGES); |
17 long page_size = sysconf(_SC_PAGE_SIZE); | 18 long page_size = sysconf(_SC_PAGE_SIZE); |
18 if (pages == -1 || page_size == -1) { | 19 if (pages == -1 || page_size == -1) { |
19 NOTREACHED(); | 20 NOTREACHED(); |
(...skipping 20 matching lines...) Expand all Loading... | |
40 limit_valid = true; | 41 limit_valid = true; |
41 } else { | 42 } else { |
42 NOTREACHED(); | 43 NOTREACHED(); |
43 return 0; | 44 return 0; |
44 } | 45 } |
45 } | 46 } |
46 return static_cast<size_t>(limit); | 47 return static_cast<size_t>(limit); |
47 } | 48 } |
48 | 49 |
49 } // namespace base | 50 } // namespace base |
OLD | NEW |