Commit 0af2af09 authored by Peter Griess's avatar Peter Griess Committed by Viswanath Sivakumar

Fix HHWheelTimer compilation bug in libc++ build

Summary:
- Manually swap bucket_ entries in HHWheelTimer to work around a bug in
libc++

Test Plan:
- fbconfig -r folly/io/async && fbmake runtests --extended-tests
- Sync to OS X and build there

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, doug, seanc, folly-diffs@

FB internal diff: D1766601

Signature: t1:1766601:1420566916:24a2911e997ee04f0934884bdf7b82345cb2b752
parent 27188837
......@@ -205,7 +205,20 @@ void HHWheelTimer::timeoutExpired() noexcept {
size_t HHWheelTimer::cancelAll() {
decltype(buckets_) buckets;
// Work around std::swap() bug in libc++
//
// http://llvm.org/bugs/show_bug.cgi?id=22106
#if FOLLY_USE_LIBCPP
for (size_t i = 0; i < WHEEL_BUCKETS; ++i) {
for (size_t ii = 0; i < WHEEL_SIZE; ++ii) {
std::swap(buckets_[i][ii], buckets[i][ii]);
}
}
#else
std::swap(buckets, buckets_);
#endif
size_t count = 0;
for (auto& tick : buckets) {
......
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