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

Function Reserve

cpp/src/arrow/buffer_builder.h:93–99  ·  view source on GitHub ↗

\brief Ensure that builder can accommodate the additional number of bytes without the need to perform allocations \param[in] additional_bytes number of additional bytes to make space for \return Status

Source from the content-addressed store, hash-verified

91 /// \param[in] additional_bytes number of additional bytes to make space for
92 /// \return Status
93 Status Reserve(const int64_t additional_bytes) {
94 auto min_capacity = size_ + additional_bytes;
95 if (min_capacity <= capacity_) {
96 return Status::OK();
97 }
98 return Resize(GrowByFactor(capacity_, min_capacity), false);
99 }
100
101 /// \brief Return a capacity expanded by the desired growth factor
102 static int64_t GrowByFactor(int64_t current_capacity, int64_t new_capacity) {

Callers 6

ResizeMethod · 0.70
TypedReserveFunction · 0.70
AppendFunction · 0.70
AppendMethod · 0.70
AppendMethod · 0.70
AdvanceMethod · 0.70

Calls 3

GrowByFactorFunction · 0.85
OKFunction · 0.70
ResizeFunction · 0.70

Tested by

no test coverage detected