Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: base/sys_info_freebsd.cc

Issue 1498003003: Remove kint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: INT64_MAX Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | base/sys_info_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <sys/sysctl.h> 7 #include <sys/sysctl.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 int64 SysInfo::AmountOfPhysicalMemory() { 13 int64_t SysInfo::AmountOfPhysicalMemory() {
14 int pages, page_size; 14 int pages, page_size;
15 size_t size = sizeof(pages); 15 size_t size = sizeof(pages);
16 sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0); 16 sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
17 sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0); 17 sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
18 if (pages == -1 || page_size == -1) { 18 if (pages == -1 || page_size == -1) {
19 NOTREACHED(); 19 NOTREACHED();
20 return 0; 20 return 0;
21 } 21 }
22 return static_cast<int64>(pages) * page_size; 22 return static_cast<int64_t>(pages) * page_size;
23 } 23 }
24 24
25 // static 25 // static
26 uint64 SysInfo::MaxSharedMemorySize() { 26 uint64_t SysInfo::MaxSharedMemorySize() {
27 size_t limit; 27 size_t limit;
28 size_t size = sizeof(limit); 28 size_t size = sizeof(limit);
29 if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) { 29 if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) {
30 NOTREACHED(); 30 NOTREACHED();
31 return 0; 31 return 0;
32 } 32 }
33 return static_cast<uint64>(limit); 33 return static_cast<uint64_t>(limit);
34 } 34 }
35 35
36 } // namespace base 36 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | base/sys_info_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698