MCPcopy Create free account
hub / github.com/apache/arrow / Resize

Function Resize

cpp/src/arrow/buffer_builder.h:76–86  ·  view source on GitHub ↗

\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

Source from the content-addressed store, hash-verified

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

Callers 4

ReserveFunction · 0.70
AppendFunction · 0.70
FinishFunction · 0.70
ReserveMethod · 0.70

Calls 6

AllocateResizableBufferFunction · 0.85
OKFunction · 0.70
ARROW_ASSIGN_OR_RAISEFunction · 0.50
ResizeMethod · 0.45
capacityMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected