From: Bryce Redd Date: Fri, 11 Sep 2015 22:46:05 +0000 (-0700) Subject: Typing changes in the LockFreeRingBuffer to support 64/32 bit iOS architectures. X-Git-Tag: deprecate-dynamic-initializer~419 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2e6f9c9bf56001b044e8120e2adf722e6ba44406;p=folly.git 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 --- 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