Just using Vector::resize() meant that we allocated exact capacity instead of leaving padding at the end. This patch adds a call to grow_capacity() before resize(), which ensures that we grow with the usual extra padding.
final