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

Unified Diff: base/sys_info_linux.cc

Issue 2054593002: Remove MaxSharedMemorySize() function from SysInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months 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.h ('k') | base/sys_info_unittest.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 300ef2c0c8b67900b2b653aca40f9de878a2db82..298d245ecf580da4d8790f5dc47f851c0208ab5d 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -33,28 +33,9 @@ int64_t AmountOfPhysicalMemory() {
return AmountOfMemory(_SC_PHYS_PAGES);
}
-uint64_t MaxSharedMemorySize() {
- std::string contents;
- base::ReadFileToString(base::FilePath("/proc/sys/kernel/shmmax"), &contents);
- DCHECK(!contents.empty());
- if (!contents.empty() && contents.back() == '\n') {
- contents.erase(contents.length() - 1);
- }
-
- uint64_t limit;
- if (!base::StringToUint64(contents, &limit)) {
- limit = 0;
- }
- DCHECK_GT(limit, 0u);
- return limit;
-}
-
base::LazyInstance<
base::internal::LazySysInfoValue<int64_t, AmountOfPhysicalMemory>>::Leaky
g_lazy_physical_memory = LAZY_INSTANCE_INITIALIZER;
-base::LazyInstance<
- base::internal::LazySysInfoValue<uint64_t, MaxSharedMemorySize>>::Leaky
- g_lazy_max_shared_memory = LAZY_INSTANCE_INITIALIZER;
} // namespace
@@ -71,11 +52,6 @@ int64_t SysInfo::AmountOfPhysicalMemory() {
}
// static
-uint64_t SysInfo::MaxSharedMemorySize() {
- return g_lazy_max_shared_memory.Get().value();
-}
-
-// static
std::string SysInfo::CPUModelName() {
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
const char kCpuModelPrefix[] = "Hardware";
« no previous file with comments | « base/sys_info.h ('k') | base/sys_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698