Skip to content

Commit bf058bc

Browse files
committed
Force explicit alignment argument to private_node_pool and shared_node_pool to avoid bugs on overaligned types.
1 parent 07806c7 commit bf058bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bench/bench_adaptive_node_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void list_test_template(std::size_t num_iterations, std::size_t num_elements, bo
228228
//Release node_allocator cache
229229
typedef boost::container::dtl::shared_node_pool
230230
< (2*sizeof(void*)+sizeof(int))
231-
, AdPoolAlignOnlyV2::nodes_per_block> shared_node_pool_t;
231+
, AdPoolAlignOnlyV2::nodes_per_block, 0> shared_node_pool_t;
232232
boost::container::dtl::singleton_default
233233
<shared_node_pool_t>::instance().purge_blocks();
234234

include/boost/container/detail/node_pool.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace dtl {
4040
//!nodes allocated per block (NodesPerBlock) are known at compile time
4141
template< std::size_t NodeSize
4242
, std::size_t NodesPerBlock
43-
, std::size_t NodeAlign = 0
43+
, std::size_t NodeAlign
4444
>
4545
class private_node_pool
4646
//Inherit from the implementation to avoid template bloat
@@ -66,7 +66,7 @@ class private_node_pool
6666

6767
template< std::size_t NodeSize
6868
, std::size_t NodesPerBlock
69-
, std::size_t NodeAlign = 0
69+
, std::size_t NodeAlign
7070
>
7171
class shared_node_pool
7272
: public private_node_pool<NodeSize, NodesPerBlock, NodeAlign>

0 commit comments

Comments
 (0)