Commit db5458a7 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Let PriorityUnboundedQueueSet align its queues

Summary: [Folly] Let `PriorityUnboundedQueueSet` align its queues, which have extended alignment, even when `std::allocator` does not honor extended alignment.

Reviewed By: magedm

Differential Revision: D19174993

fbshipit-source-id: 0bc0d75c6d239c97b6e1c7380bffff0363008e16
parent 0d92b69f
......@@ -19,6 +19,7 @@
#include <atomic>
#include <vector>
#include <folly/Memory.h>
#include <folly/concurrency/UnboundedQueue.h>
#include <folly/lang/Align.h>
......@@ -137,7 +138,12 @@ class PriorityUnboundedQueueSet {
}
private:
std::vector<queue> queues_;
// queue_alloc custom allocator is necessary until C++17
// http://open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3396.htm
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65122
// https://bugs.llvm.org/show_bug.cgi?id=22634
using queue_alloc = AlignedSysAllocator<queue, FixedAlign<alignof(queue)>>;
std::vector<queue, queue_alloc> queues_;
}; // PriorityUnboundedQueueSet
/* Aliases */
......
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