From 43f8e5e9334da7b488b706ff44eaf36a54650a98 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Wed, 28 Sep 2022 09:42:37 +0200 Subject: [PATCH] avoided being too smart in new_arrays's memory initialization --- include/boost/unordered/detail/foa.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 6bcc2b45..2970b594 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -680,7 +680,7 @@ private: new_arrays_.groups=boost::to_address(group_alloc_traits::allocate(gal,groups_size)); // TODO: explain why memset std::memset( - new_arrays_.groups,0,sizeof(group_type)*groups_size-1); + new_arrays_.groups,0,sizeof(group_type)*groups_size); new_arrays_.groups[groups_size-1].set_sentinel(); BOOST_TRY{ new_arrays_.elements=boost::to_address(alloc_traits::allocate(al,groups_size*N-1));