From: Hans Fugal Date: Thu, 26 Jun 2014 17:44:20 +0000 (-0700) Subject: Fix bizarre optimization X-Git-Tag: v0.22.0~496 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=57a00d50dd2db403ab059490fcc73ae27ecb79d8;p=folly.git 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 --- 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_; }