commit 522fc6612612126922e13ee8f21ef60048a10e62 parent 2344de768015b2fa90ae555e45474d7b58cc5539 Author: Michael Savage <mikejsavage@gmail.com> Date: Thu Sep 1 13:23:12 -0700 Use size_t instead of u64 for SPSC queue size Diffstat:
nonblocking_fixed_spsc_queue.h | | | 8 | ++++---- |
diff --git a/nonblocking_fixed_spsc_queue.h b/nonblocking_fixed_spsc_queue.h @@ -6,7 +6,7 @@ #include "platform_atomic.h" -template< typename T, u64 N > +template< typename T, size_t N > class NonblockingFixedSPSCQueue : public NonblockingQueue< T > { public: NonblockingFixedSPSCQueue() { @@ -48,7 +48,7 @@ public: } void clear() { - for( u64 i = 0; i < N; i++ ) { + for( size_t i = 0; i < N; i++ ) { store_release( &nodes[ i ].last_op, READ ); } VAR( reader_pos ) = VAR( writer_pos ) = 0; @@ -71,10 +71,10 @@ private: Node nodes[ N ]; CACHE_LINE_PADDING; - nonatomic( u64 ) reader_pos; + nonatomic( size_t ) reader_pos; nonatomic( bool ) reader_acquired; CACHE_LINE_PADDING; - nonatomic( u64 ) writer_pos; + nonatomic( size_t ) writer_pos; }; #endif // _NONBLOCKING_FIXED_SPSC_QUEUE_H_