diff --git a/include/psi/vm/vector.hpp b/include/psi/vm/vector.hpp index 40b3831..1889f46 100644 --- a/include/psi/vm/vector.hpp +++ b/include/psi/vm/vector.hpp @@ -25,8 +25,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -1100,7 +1101,14 @@ class vector storage_.expand( to_byte_sz( target_size ) ); if constexpr ( std::is_trivially_constructible_v ) { - std::memset( data() + current_size, 0, target_size - current_size * sizeof( T ) ); + [[ maybe_unused ]] auto const newSpaceBegin{ reinterpret_cast( data() + current_size ) }; + [[ maybe_unused ]] auto const newSpaceSize { ( target_size - current_size ) * sizeof( value_type ) }; + //std::memset( newSpaceBegin, 0, newSpaceSize ); + BOOST_ASSERT_MSG + ( + *std::max_element( newSpaceBegin, newSpaceBegin + newSpaceSize ) == 0, + "Expecting files to be zero-extended" + ); } else {