diff --git a/cpp/arcticdb/column_store/chunked_buffer.hpp b/cpp/arcticdb/column_store/chunked_buffer.hpp index b42aa8219d7..4d725fd1681 100644 --- a/cpp/arcticdb/column_store/chunked_buffer.hpp +++ b/cpp/arcticdb/column_store/chunked_buffer.hpp @@ -14,12 +14,22 @@ #include #include +#ifdef DEBUG_BUILD #include +#endif #include namespace arcticdb { +#ifdef DEBUG_BUILD +using MemBlockVectorType = std::vector; +using MemBlockOffsetsVectorType = std::vector; +#else +using MemBlockVectorType = boost::container::small_vector; +using MemBlockOffsetsVectorType = boost::container::small_vector; +#endif + /* * ChunkedBufferImpl is an untyped buffer that is composed of blocks of data that can be either regularly or * irregularly sized, with optimizations for the following representations: @@ -400,14 +410,8 @@ class ChunkedBufferImpl { size_t bytes_ = 0; size_t regular_sized_until_ = 0; -//#define DEBUG_BUILD -#ifndef DEBUG_BUILD - boost::container::small_vector blocks_; - boost::container::small_vector block_offsets_; -#else - std::vector blocks_; - std::vector block_offsets_; -#endif + MemBlockVectorType blocks_; + MemBlockOffsetsVectorType block_offsets_; }; constexpr size_t PageSize = 4096; diff --git a/cpp/arcticdb/column_store/column.cpp b/cpp/arcticdb/column_store/column.cpp index da64aa8b3ba..61e4563de83 100644 --- a/cpp/arcticdb/column_store/column.cpp +++ b/cpp/arcticdb/column_store/column.cpp @@ -562,7 +562,7 @@ void Column::compact_blocks() { data_.compact_blocks(); } -const std::vector& Column::blocks() const { +const MemBlockVectorType& Column::blocks() const { return data_.buffer().blocks(); } diff --git a/cpp/arcticdb/column_store/column.hpp b/cpp/arcticdb/column_store/column.hpp index 4515399ccb9..0c89edef89d 100644 --- a/cpp/arcticdb/column_store/column.hpp +++ b/cpp/arcticdb/column_store/column.hpp @@ -445,7 +445,7 @@ class Column { void compact_blocks(); - const std::vector& blocks() const; + const MemBlockVectorType& blocks() const; template std::optional scalar_at(position_t row) const {