Commit bcaf9cdf authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

Remove trivial-copyability req from LockFreeRingBuffer

Summary: [Folly] Remove trivial-copyability requirement from `LockFreeRingBuffer` since we can rely on the compiler to optimize copy operations over types which are trivially-copyable without our code having to specify `memcpy`.

Reviewed By: yfeldblum

Differential Revision: D19844612

fbshipit-source-id: 4770e46ac8c63fa68b68598fb5012cb58896f550
parent 7ce27feb
......@@ -59,10 +59,6 @@ class LockFreeRingBuffer {
std::is_nothrow_default_constructible<T>::value,
"Element type must be nothrow default constructible");
static_assert(
folly::is_trivially_copyable<T>::value,
"Element type must be trivially copyable");
public:
/// Opaque pointer to a past or future write.
/// Can be moved relative to its current location but not in absolute terms.
......@@ -185,10 +181,6 @@ class LockFreeRingBuffer {
namespace detail {
template <typename T, template <typename> class Atom>
class RingBufferSlot {
void copy(T& dest, T& src) {
memcpy(&dest, &src, sizeof(T));
}
template <typename V>
void copy(V& dest, T& src) {
dest = src;
......
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