Commit 93b973c3 authored by Jose Dapena Paz's avatar Jose Dapena Paz Committed by Commit Bot

GCC: do not use namespace linux in system memory pressure evaluator

GCC fails to compile system memory pressure evaluator, as the
linux implementation is in linux namespace. But in GCC, linux
is a reserved word, so it should not be used. To fix the
problem, we rename the new namespace to os_linux.

../../base/util/memory_pressure/system_memory_pressure_evaluator_linux.h:16:11: error: expected identifier before numeric constant
   16 | namespace linux {
      |           ^~~~~

Bug: 819294
Change-Id: I3edcbbbb91fe99aab8c0be952385bb38bb1e27e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394158Reviewed-by: default avatarSébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/master@{#807099}
parent c3ebff7a
......@@ -46,7 +46,7 @@ SystemMemoryPressureEvaluator::CreateDefaultSystemEvaluator(
}
return evaluator;
#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
return std::make_unique<util::linux::SystemMemoryPressureEvaluator>(
return std::make_unique<util::os_linux::SystemMemoryPressureEvaluator>(
monitor->CreateVoter());
#endif
return nullptr;
......
......@@ -32,7 +32,7 @@ int GetAvailableSystemMemoryMiB(const base::SystemMemoryInfoKB& mem_info) {
} // namespace
namespace util {
namespace linux {
namespace os_linux {
const base::TimeDelta SystemMemoryPressureEvaluator::kModeratePressureCooldown =
base::TimeDelta::FromSeconds(10);
......@@ -153,5 +153,5 @@ SystemMemoryPressureEvaluator::CalculateCurrentPressureLevel() {
return base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE;
}
} // namespace linux
} // namespace os_linux
} // namespace util
......@@ -13,7 +13,7 @@
#include "base/util/memory_pressure/system_memory_pressure_evaluator.h"
namespace util {
namespace linux {
namespace os_linux {
// Linux memory pressure voter. Because there is no OS provided signal this
// polls at a low frequency, and applies internal hysteresis.
......@@ -106,7 +106,7 @@ class SystemMemoryPressureEvaluator
SEQUENCE_CHECKER(sequence_checker_);
};
} // namespace linux
} // namespace os_linux
} // namespace util
#endif // BASE_UTIL_MEMORY_PRESSURE_SYSTEM_MEMORY_PRESSURE_EVALUATOR_LINUX_H_
......@@ -13,7 +13,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace util {
namespace linux {
namespace os_linux {
namespace {
......@@ -257,5 +257,5 @@ TEST_F(LinuxSystemMemoryPressureEvaluatorTest, CheckMemoryPressure) {
testing::Mock::VerifyAndClearExpectations(&evaluator);
}
} // namespace linux
} // namespace os_linux
} // namespace util
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment