From 2e6f9c9bf56001b044e8120e2adf722e6ba44406 Mon Sep 17 00:00:00 2001 From: Bryce Redd Date: Fri, 11 Sep 2015 15:46:05 -0700 Subject: [PATCH] Typing changes in the LockFreeRingBuffer to support 64/32 bit iOS architectures. Summary: The capacity variable changed types, and turn function needed an explicit cast. Reviewed By: @BurntBrunch Differential Revision: D2421421 --- folly/experimental/LockFreeRingBuffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/folly/experimental/LockFreeRingBuffer.h b/folly/experimental/LockFreeRingBuffer.h index f8dff773..8d7bcc01 100644 --- a/folly/experimental/LockFreeRingBuffer.h +++ b/folly/experimental/LockFreeRingBuffer.h @@ -87,7 +87,7 @@ public: friend class LockFreeRingBuffer; }; - explicit LockFreeRingBuffer(size_t capacity) noexcept + explicit LockFreeRingBuffer(uint32_t capacity) noexcept : capacity_(capacity) , slots_(new detail::RingBufferSlot[capacity]) , ticket_(0) @@ -145,7 +145,7 @@ public: } private: - const size_t capacity_; + const uint32_t capacity_; const std::unique_ptr[]> slots_; @@ -156,7 +156,7 @@ private: } uint32_t turn(uint64_t ticket) noexcept { - return (ticket / capacity_); + return (uint32_t)(ticket / capacity_); } }; // LockFreeRingBuffer -- 2.34.1