From bf058bcc544c618abf036bcf7187624fa4d5cc48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 20 Jan 2026 23:57:43 +0100 Subject: [PATCH] Force explicit alignment argument to private_node_pool and shared_node_pool to avoid bugs on overaligned types. --- bench/bench_adaptive_node_pool.cpp | 2 +- include/boost/container/detail/node_pool.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bench/bench_adaptive_node_pool.cpp b/bench/bench_adaptive_node_pool.cpp index 41ce9db..a0faaa2 100644 --- a/bench/bench_adaptive_node_pool.cpp +++ b/bench/bench_adaptive_node_pool.cpp @@ -228,7 +228,7 @@ void list_test_template(std::size_t num_iterations, std::size_t num_elements, bo //Release node_allocator cache typedef boost::container::dtl::shared_node_pool < (2*sizeof(void*)+sizeof(int)) - , AdPoolAlignOnlyV2::nodes_per_block> shared_node_pool_t; + , AdPoolAlignOnlyV2::nodes_per_block, 0> shared_node_pool_t; boost::container::dtl::singleton_default ::instance().purge_blocks(); diff --git a/include/boost/container/detail/node_pool.hpp b/include/boost/container/detail/node_pool.hpp index 2647eca..30b79bd 100644 --- a/include/boost/container/detail/node_pool.hpp +++ b/include/boost/container/detail/node_pool.hpp @@ -40,7 +40,7 @@ namespace dtl { //!nodes allocated per block (NodesPerBlock) are known at compile time template< std::size_t NodeSize , std::size_t NodesPerBlock - , std::size_t NodeAlign = 0 + , std::size_t NodeAlign > class private_node_pool //Inherit from the implementation to avoid template bloat @@ -66,7 +66,7 @@ class private_node_pool template< std::size_t NodeSize , std::size_t NodesPerBlock - , std::size_t NodeAlign = 0 + , std::size_t NodeAlign > class shared_node_pool : public private_node_pool