diff --git a/util/autovector.h b/util/autovector.h index 1e6c4716b..7e33e5ca8 100644 --- a/util/autovector.h +++ b/util/autovector.h @@ -19,6 +19,12 @@ namespace ROCKSDB_NAMESPACE { template class autovector : public std::vector { using std::vector::vector; + + public: + autovector() { + // Make sure the initial vector has space for kSize elements + std::vector::reserve(kSize); + } }; #else // A vector that leverages pre-allocated stack-based array to achieve better