From 57a00d50dd2db403ab059490fcc73ae27ecb79d8 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Thu, 26 Jun 2014 10:44:20 -0700 Subject: [PATCH] Fix bizarre optimization Summary: I have no idea why the compiler is gettings its britches in a bunch because a unit test has a predictable output. Really, gcc?! But whatever, avoiding inlining by putting it in the cpp file solves it. Test Plan: fbmake runtests_opt Reviewed By: davejwatson@fb.com Subscribers: net-systems@, fugalh, exa FB internal diff: D1405811 Tasks: 4591823 --- folly/wangle/ManualExecutor.cpp | 7 +++++++ folly/wangle/ManualExecutor.h | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/folly/wangle/ManualExecutor.cpp b/folly/wangle/ManualExecutor.cpp index eed8a84d..2c081301 100644 --- a/folly/wangle/ManualExecutor.cpp +++ b/folly/wangle/ManualExecutor.cpp @@ -94,4 +94,11 @@ void ManualExecutor::wait() { } } +void ManualExecutor::advanceTo(TimePoint const& t) { + if (t > now_) { + now_ = t; + } + run(); +} + }} // namespace diff --git a/folly/wangle/ManualExecutor.h b/folly/wangle/ManualExecutor.h index e7fb8190..1eb569f0 100644 --- a/folly/wangle/ManualExecutor.h +++ b/folly/wangle/ManualExecutor.h @@ -76,12 +76,7 @@ namespace folly { namespace wangle { /// Advance the clock to this absolute time. If t is <= now(), /// this is a noop. - void advanceTo(TimePoint const& t) { - if (t > now_) { - now_ = t; - } - run(); - } + void advanceTo(TimePoint const& t); TimePoint now() override { return now_; } -- 2.34.1