@@ -129,14 +129,6 @@ struct TbbAdapter : RetryDecorator<Queue> {
129129
130130// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
131131
132- template <class Queue , size_t Capacity>
133- struct CapacityToConstructor : Queue {
134- CapacityToConstructor ()
135- : Queue(Capacity) {}
136- };
137-
138- // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
139-
140132using Allocator = HugePageAllocator<unsigned >;
141133using BoostAllocator = boost::lockfree::allocator<Allocator>;
142134
@@ -160,14 +152,14 @@ struct QueueTypes {
160152 // For atomic elements only.
161153 using AtomicQueue = Type<RetryDecorator<atomic_queue::AtomicQueue<T, SIZE , T{}, MINIMIZE_CONTENTION , MAXIMIZE_THROUGHPUT , false , SPSC >>>;
162154 using OptimistAtomicQueue = Type<atomic_queue::AtomicQueue<T, SIZE , T{}, MINIMIZE_CONTENTION , MAXIMIZE_THROUGHPUT , false , SPSC >>;
163- using AtomicQueueB = Type<RetryDecorator<CapacityToConstructor <atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>>;
164- using OptimistAtomicQueueB = Type<CapacityToConstructor <atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>;
155+ using AtomicQueueB = Type<RetryDecorator<CapacityArgDecorator <atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>>;
156+ using OptimistAtomicQueueB = Type<CapacityArgDecorator <atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>;
165157
166158 // For non-atomic elements.
167159 using AtomicQueue2 = Type<RetryDecorator<atomic_queue::AtomicQueue2<T, SIZE , MINIMIZE_CONTENTION , MAXIMIZE_THROUGHPUT , false , SPSC >>>;
168160 using OptimistAtomicQueue2 = Type<atomic_queue::AtomicQueue2<T, SIZE , MINIMIZE_CONTENTION , MAXIMIZE_THROUGHPUT , false , SPSC >>;
169- using AtomicQueueB2 = Type<RetryDecorator<CapacityToConstructor <atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>>;
170- using OptimistAtomicQueueB2 = Type<CapacityToConstructor <atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>;
161+ using AtomicQueueB2 = Type<RetryDecorator<CapacityArgDecorator <atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>>;
162+ using OptimistAtomicQueueB2 = Type<CapacityArgDecorator <atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT , false , SPSC >, SIZE >>;
171163};
172164
173165// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -354,7 +346,7 @@ void run_throughput_benchmarks(HugePages& hp, std::vector<CpuTopologyInfo> const
354346 run_throughput_mpmc_benchmark (" xenium::ramalhete_queue" , hp, hw_thread_ids,
355347 Type<XeniumQueueAdapter<xenium::ramalhete_queue<unsigned , xenium::policy::reclaimer<Reclaimer>>>>{});
356348 run_throughput_mpmc_benchmark (" xenium::vyukov_bounded_queue" , hp, hw_thread_ids,
357- Type<RetryDecorator<CapacityToConstructor <xenium::vyukov_bounded_queue<unsigned >, SIZE >>>{});
349+ Type<RetryDecorator<CapacityArgDecorator <xenium::vyukov_bounded_queue<unsigned >, SIZE >>>{});
358350
359351 using SPSC = QueueTypes<SIZE , true , false , false >;
360352 using MPMC = QueueTypes<SIZE , false , true , true >; // Enable MAXIMIZE_THROUGHPUT for 2 or more producers/consumers.
@@ -501,7 +493,7 @@ void run_ping_pong_benchmarks(HugePages& hp, std::vector<CpuTopologyInfo> const&
501493
502494 run_ping_pong_benchmark<XeniumQueueAdapter<xenium::michael_scott_queue<unsigned , xenium::policy::reclaimer<Reclaimer>>>>(" xenium::michael_scott_queue" , hp, hw_thread_ids);
503495 run_ping_pong_benchmark<XeniumQueueAdapter<xenium::ramalhete_queue<unsigned , xenium::policy::reclaimer<Reclaimer>>>>(" xenium::ramalhete_queue" , hp, hw_thread_ids);
504- run_ping_pong_benchmark<RetryDecorator<CapacityToConstructor <xenium::vyukov_bounded_queue<unsigned >, SIZE >>>(" xenium::vyukov_bounded_queue" , hp, hw_thread_ids);
496+ run_ping_pong_benchmark<RetryDecorator<CapacityArgDecorator <xenium::vyukov_bounded_queue<unsigned >, SIZE >>>(" xenium::vyukov_bounded_queue" , hp, hw_thread_ids);
505497
506498 // Use MAXIMIZE_THROUGHPUT=false for better latency.
507499 using SPSC = QueueTypes<SIZE , true , false , false >;
0 commit comments