Minor fix
authorDelyan Kratunov <delyank@fb.com>
Tue, 2 Jun 2015 04:35:34 +0000 (21:35 -0700)
committerNoam Lerner <noamler@fb.com>
Wed, 3 Jun 2015 16:54:28 +0000 (09:54 -0700)
Summary:
`LockFreeRingBuffer` was using `std::unique_ptr` but not importing `memory`.
Also, Android NDK's libstdc++ doesn't provide `std::llround`, use straight
`llround`, we don't need the constexpr-ness anyway.

Test Plan: `fbmake runtests`

Reviewed By: jmkaldor@fb.com

Subscribers: folly-diffs@, yfeldblum, chalfant

FB internal diff: D2116923

Signature: t1:2116923:1433210832:9ec0ed7f558c271a51d528b8f88fbce9b466ba3a

folly/experimental/LockFreeRingBuffer.h

index 87ed084e44cc1a6a9a6df9bb6035bc8bdbb2a05c..f8dff773c317eafb3af13bb26bebd7da09c13815 100644 (file)
@@ -20,6 +20,7 @@
 #include <boost/noncopyable.hpp>
 #include <iostream>
 #include <cmath>
+#include <memory>
 #include <string.h>
 #include <type_traits>
 #include <unistd.h>
@@ -129,7 +130,7 @@ public:
     assert(skipFraction >= 0.0 && skipFraction <= 1.0);
     uint64_t ticket = ticket_.load();
 
-    uint64_t backStep = std::llround((1.0 - skipFraction) * capacity_);
+    uint64_t backStep = llround((1.0 - skipFraction) * capacity_);
 
     // always try to move at least one step backward to something readable
     backStep = std::max<uint64_t>(1, backStep);