@@ -86,9 +86,9 @@ namespace seq
8686 // Bucket structure, stores up to count elements
8787 struct Bucket : BaseBucket
8888 {
89- atomic_type cnt{ mask_full }; // Mask of created (constructed) elements
90- atomic_type pop{ 0 }; // Mask of poped (removed) elements
91- RawStorage<T, count> values; // Elements
89+ atomic_type cnt{ mask_full }; // Mask of created (constructed) elements
90+ atomic_type pop{ 0 }; // Mask of poped (removed) elements
91+ RawStorage<T, count> values; // Elements
9292
9393 // Return bitmask of valid elements
9494 size_type valid_mask () const noexcept { return cnt.load (std::memory_order_relaxed) & (~pop.load (std::memory_order_relaxed)); }
@@ -116,12 +116,11 @@ namespace seq
116116 };
117117
118118 private:
119-
120119 static constexpr std::size_t cache_line_size = 64 ;
121120
122- alignas (cache_line_size) atomic_type d_head{ 0 };// Head (insert) position
123- alignas (cache_line_size) atomic_type d_tail{ 0 };// Tail (pop) position
124- alignas (cache_line_size) BaseBucket d_end; // End bucket of linked list
121+ alignas (cache_line_size) atomic_type d_head{ 0 }; // Head (insert) position
122+ alignas (cache_line_size) atomic_type d_tail{ 0 }; // Tail (pop) position
123+ alignas (cache_line_size) BaseBucket d_end; // End bucket of linked list
125124
126125 // Free list of buckets
127126 atomic_bucket d_free{ nullptr };
@@ -285,7 +284,7 @@ namespace seq
285284 continue ;
286285
287286 // Retrieve/destroy value
288- fun (*bucket->values .live_slot (idx));
287+ fun (*bucket->values .live_slot ((std:: size_t ) idx));
289288 // Mark as poped
290289 auto popped = bucket->pop .fetch_or (idx_bits, std::memory_order_acq_rel) | idx_bits;
291290
@@ -330,7 +329,7 @@ namespace seq
330329 }
331330
332331 auto bucket = static_cast <Bucket*>(last);
333- new (bucket->values .raw_slot (idx)) T (std::move (val));
332+ new (bucket->values .raw_slot ((std:: size_t ) idx)) T (std::move (val));
334333 bucket->cnt .fetch_or (size_type{ 1 } << idx, std::memory_order_release);
335334
336335 // Free potentially reserved bucket.
@@ -413,7 +412,7 @@ namespace seq
413412 SEQ_ALWAYS_INLINE void emplace (Args&&... args)
414413 {
415414 // Create value upfront as this might throw
416- T val ( std::forward<Args>(args)... );
415+ T val (std::forward<Args>(args)...);
417416
418417 // Increment head position, and make sure a bucket is availble if needed BEFORE increment
419418 // to avoid potential bad_alloc exception to corrupt the head state.
@@ -471,7 +470,7 @@ namespace seq
471470 {
472471 auto h = d_head.load (std::memory_order_relaxed);
473472 auto t = d_tail.load (std::memory_order_relaxed);
474- return h > t ? (h - t) : 0 ;
473+ return h > t ? static_cast <std:: size_t > (h - t) : std:: size_t { 0 } ;
475474 }
476475 SEQ_ALWAYS_INLINE bool empty () const noexcept { return size () == 0 ; }
477476 };
@@ -686,7 +685,7 @@ namespace seq
686685 : Allocator(al)
687686 {
688687 concurrent_queue tmp (al);
689- tmp.reserve (count);
688+ tmp.reserve (( size_t ) count);
690689 d_data.store (tmp.d_data .exchange (nullptr ));
691690 }
692691
0 commit comments