Commit 2e6f9c9b authored by Bryce Redd's avatar Bryce Redd Committed by facebook-github-bot-1

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
parent 84138864
......@@ -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<T,Atom>[capacity])
, ticket_(0)
......@@ -145,7 +145,7 @@ public:
}
private:
const size_t capacity_;
const uint32_t capacity_;
const std::unique_ptr<detail::RingBufferSlot<T,Atom>[]> slots_;
......@@ -156,7 +156,7 @@ private:
}
uint32_t turn(uint64_t ticket) noexcept {
return (ticket / capacity_);
return (uint32_t)(ticket / capacity_);
}
}; // LockFreeRingBuffer
......
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