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

Unified Diff: base/sys_info_linux.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sys_info_ios.mm ('k') | base/sys_info_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_linux.cc
diff --git a/base/sys_info_linux.cc b/base/sys_info_linux.cc
index 1bbfe9c604e0f422efe4e990e8fab8d69f2df84b..8ee967ff49a5c04bd81db2b3c1a7e2f0d1960316 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -15,21 +15,21 @@
namespace {
-int64 AmountOfMemory(int pages_name) {
+int64_t AmountOfMemory(int pages_name) {
long pages = sysconf(pages_name);
long page_size = sysconf(_SC_PAGESIZE);
if (pages == -1 || page_size == -1) {
NOTREACHED();
return 0;
}
- return static_cast<int64>(pages) * page_size;
+ return static_cast<int64_t>(pages) * page_size;
}
-int64 AmountOfPhysicalMemory() {
+int64_t AmountOfPhysicalMemory() {
return AmountOfMemory(_SC_PHYS_PAGES);
}
-uint64 MaxSharedMemorySize() {
+uint64_t MaxSharedMemorySize() {
std::string contents;
base::ReadFileToString(base::FilePath("/proc/sys/kernel/shmmax"), &contents);
DCHECK(!contents.empty());
@@ -37,7 +37,7 @@ uint64 MaxSharedMemorySize() {
contents.erase(contents.length() - 1);
}
- uint64 limit;
+ uint64_t limit;
if (!base::StringToUint64(contents, &limit)) {
limit = 0;
}
@@ -46,10 +46,10 @@ uint64 MaxSharedMemorySize() {
}
base::LazyInstance<
- base::internal::LazySysInfoValue<int64, AmountOfPhysicalMemory> >::Leaky
+ base::internal::LazySysInfoValue<int64_t, AmountOfPhysicalMemory>>::Leaky
g_lazy_physical_memory = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<
- base::internal::LazySysInfoValue<uint64, MaxSharedMemorySize> >::Leaky
+ base::internal::LazySysInfoValue<uint64_t, MaxSharedMemorySize>>::Leaky
g_lazy_max_shared_memory = LAZY_INSTANCE_INITIALIZER;
} // namespace
@@ -57,17 +57,17 @@ base::LazyInstance<
namespace base {
// static
-int64 SysInfo::AmountOfAvailablePhysicalMemory() {
+int64_t SysInfo::AmountOfAvailablePhysicalMemory() {
return AmountOfMemory(_SC_AVPHYS_PAGES);
}
// static
-int64 SysInfo::AmountOfPhysicalMemory() {
+int64_t SysInfo::AmountOfPhysicalMemory() {
return g_lazy_physical_memory.Get().value();
}
// static
-uint64 SysInfo::MaxSharedMemorySize() {
+uint64_t SysInfo::MaxSharedMemorySize() {
return g_lazy_max_shared_memory.Get().value();
}
« no previous file with comments | « base/sys_info_ios.mm ('k') | base/sys_info_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698