From 72ff09d7d254a9e682b75876caf8088623f671f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 13 Jan 2026 01:26:43 +0100 Subject: [PATCH] Fix bug, m_nodes_per_block was directly used instead of unpacking its value and stripping the stored bits. --- include/boost/container/detail/node_pool_impl.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/container/detail/node_pool_impl.hpp b/include/boost/container/detail/node_pool_impl.hpp index 5d303cd..39254f2 100644 --- a/include/boost/container/detail/node_pool_impl.hpp +++ b/include/boost/container/detail/node_pool_impl.hpp @@ -295,11 +295,12 @@ class private_node_pool_impl { packed_3n_bits_ref_t packer(m_real_node_size, m_nodes_per_block, m_allocated); size_type allocated = packer.high2_unpacked(); + size_type nodes_per_block = packer.high1_unpacked(); //Preallocate all needed blocks to fulfill the request size_type cur_nodes = m_freelist.size(); if(cur_nodes < n){ - this->priv_alloc_block(((n - cur_nodes) - 1)/m_nodes_per_block + 1); + this->priv_alloc_block(((n - cur_nodes) - 1)/nodes_per_block + 1); } //We just iterate the needed nodes to get the last we'll erase