Fix bizarre optimization
authorHans Fugal <fugalh@fb.com>
Thu, 26 Jun 2014 17:44:20 +0000 (10:44 -0700)
committerNicholas Ormrod <njormrod@fb.com>
Fri, 27 Jun 2014 22:06:07 +0000 (15:06 -0700)
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
folly/wangle/ManualExecutor.h

index eed8a84d597d7f34c5d0111d79ebdc03cf3dd766..2c0813011ff7e72109b1bd7e57541f1c2947b418 100644 (file)
@@ -94,4 +94,11 @@ void ManualExecutor::wait() {
   }
 }
 
+void ManualExecutor::advanceTo(TimePoint const& t) {
+  if (t > now_) {
+    now_ = t;
+  }
+  run();
+}
+
 }} // namespace
index e7fb8190935ebaead15355fe59c2e4c677149275..1eb569f0b57496a865568c1caafc12219104f6bb 100644 (file)
@@ -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_; }