\brief Resize the buffer to the nearest multiple of 64 bytes \param new_capacity the new capacity of the builder. Will be rounded up to a multiple of 64 bytes for padding \param shrink_to_fit if new capacity is smaller than the existing, reallocate internal buffer. Set to false to avoid reallocations when shrinking the builder. \return Status
| 74 | /// shrinking the builder. |
| 75 | /// \return Status |
| 76 | Status Resize(const int64_t new_capacity, bool shrink_to_fit = true) { |
| 77 | if (buffer_ == NULLPTR) { |
| 78 | ARROW_ASSIGN_OR_RAISE(buffer_, |
| 79 | AllocateResizableBuffer(new_capacity, alignment_, pool_)); |
| 80 | } else { |
| 81 | ARROW_RETURN_NOT_OK(buffer_->Resize(new_capacity, shrink_to_fit)); |
| 82 | } |
| 83 | capacity_ = buffer_->capacity(); |
| 84 | data_ = buffer_->mutable_data(); |
| 85 | return Status::OK(); |
| 86 | } |
| 87 | |
| 88 | /// \brief Ensure that builder can accommodate the additional number of bytes |
| 89 | /// without the need to perform allocations |
no test coverage detected