Skip to content

Commit

Permalink
ARROW-1945: [C++] Add data_capacity_ to track capacity of value data
Browse files Browse the repository at this point in the history
  • Loading branch information
xuepanchen committed Jan 18, 2018
1 parent 18f90fb commit 0b07895
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/arrow/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class ARROW_EXPORT BinaryBuilder : public ArrayBuilder {
/// \return size of values buffer so far
int64_t value_data_length() const { return value_data_builder_.length(); }
/// \return capacity of values buffer
int64_t value_data_capacity() const { return value_data_builder_.capacity(); }
int64_t value_data_capacity() const { return data_capacity_; }

/// Temporary access to a value.
///
Expand All @@ -699,6 +699,7 @@ class ARROW_EXPORT BinaryBuilder : public ArrayBuilder {
TypedBufferBuilder<int32_t> offsets_builder_;
TypedBufferBuilder<uint8_t> value_data_builder_;

int64_t data_capacity_;
static constexpr int64_t kMaximumCapacity = std::numeric_limits<int32_t>::max() - 1;

Status AppendNextOffset();
Expand Down

0 comments on commit 0b07895

Please sign in to comment.