Commit 9442f946 authored by Gabriel Charette's avatar Gabriel Charette

[TaskScheduler] Require constant initialization for g_heartbeat_for_testing

Somehow r562248 caused a regression whereby it should have been strictly
more performant, the only difference is the potential static
initializer (which if incorrectly initialized could result in it being
non-zero? and somehow cause the timer to be fast?).
Let's try to suppress it.

R=fdoray@chromium.org

Bug: 848255
Change-Id: I21111ddd4c069b9171badc58fc4a1914bb068641
Reviewed-on: https://chromium-review.googlesource.com/1090794Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578420}
parent c31de326
...@@ -13,13 +13,19 @@ ...@@ -13,13 +13,19 @@
#include "base/task_scheduler/task_scheduler.h" #include "base/task_scheduler/task_scheduler.h"
#include "base/task_scheduler/task_tracker.h" #include "base/task_scheduler/task_tracker.h"
#include "base/task_scheduler/task_traits.h" #include "base/task_scheduler/task_traits.h"
#include "build/build_config.h"
namespace base { namespace base {
namespace internal { namespace internal {
namespace { namespace {
TimeDelta g_heartbeat_for_testing = TimeDelta(); // TODO(gab): Verify whether this attribute addresses https://crbug.com/848255
// and consider a way to expose it more widely.
#if defined(__clang__) && !defined(OS_NACL)
[[clang::require_constant_initialization]]
#endif
TimeDelta g_heartbeat_for_testing = TimeDelta();
} // namespace } // namespace
......
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