Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
args: [--fix=auto]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.3
rev: v22.1.5
hooks:
- id: clang-format
types_or: [c++, c, cuda]
6 changes: 1 addition & 5 deletions include/boost/lockfree/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ class queue

#endif
public:

/** Pops object from queue.
*
* \post if pop operation is successful, object will be copied to ret.
Expand Down Expand Up @@ -627,10 +626,7 @@ class queue
private:
#ifndef BOOST_DOXYGEN_INVOKED
atomic< tagged_node_handle > head_;
static constexpr int padding_size = detail::cacheline_bytes - sizeof( tagged_node_handle );
char padding1[ padding_size ];
atomic< tagged_node_handle > tail_;
char padding2[ padding_size ];
alignas( detail::cacheline_bytes ) atomic< tagged_node_handle > tail_;

pool_t pool;
#endif
Expand Down
8 changes: 3 additions & 5 deletions include/boost/lockfree/spsc_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ class ringbuffer_base
{
#ifndef BOOST_DOXYGEN_INVOKED
protected:
typedef std::size_t size_t;
static constexpr int padding_size = cacheline_bytes - sizeof( size_t );
atomic< size_t > write_index_;
char padding1[ padding_size ]; /* force read_index and write_index to different cache lines */
atomic< size_t > read_index_;
typedef std::size_t size_t;
alignas( cacheline_bytes ) atomic< size_t > write_index_;
alignas( cacheline_bytes ) atomic< size_t > read_index_;

protected:
ringbuffer_base( void ) :
Expand Down
5 changes: 1 addition & 4 deletions include/boost/lockfree/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,7 @@ class stack
#ifndef BOOST_DOXYGEN_INVOKED
detail::atomic< tagged_node_handle > tos;

static const int padding_size = detail::cacheline_bytes - sizeof( tagged_node_handle );
char padding[ padding_size ];

pool_t pool;
alignas( detail::cacheline_bytes ) pool_t pool;
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion test/spsc_queue_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ BOOST_AUTO_TEST_CASE( spsc_queue_consume_all_test_compile_time )
f.push( 3 );

std::vector< int > consumed;
size_t count = f.consume_all( [&]( int i ) {
size_t count = f.consume_all( [ & ]( int i ) {
consumed.push_back( i );
} );

Expand Down
4 changes: 2 additions & 2 deletions test/stack_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ BOOST_AUTO_TEST_CASE( stack_consume_all_atomic_order_test )

// consume_all_atomic pops all atomically and then processes in stack order (LIFO: 3, 2, 1)
std::vector< int > consumed_order;
size_t consumed = f.consume_all_atomic( [&]( int i ) {
size_t consumed = f.consume_all_atomic( [ & ]( int i ) {
consumed_order.push_back( i );
} );

Expand All @@ -361,7 +361,7 @@ BOOST_AUTO_TEST_CASE( stack_consume_all_atomic_reversed_order_test )

// consume_all_atomic_reversed processes in FIFO order (1, 2, 3)
std::vector< int > consumed_order;
size_t consumed = f.consume_all_atomic_reversed( [&]( int i ) {
size_t consumed = f.consume_all_atomic_reversed( [ & ]( int i ) {
consumed_order.push_back( i );
} );

Expand Down
Loading