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

Method ensure_capacity

cpp/src/arrow/util/small_vector.h:134–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132 }
133
134 void ensure_capacity(size_t min_capacity) {
135 if (dynamic_capacity_) {
136 // Grow dynamic storage if necessary
137 if (min_capacity > dynamic_capacity_) {
138 size_t new_capacity = std::max(dynamic_capacity_ * 2, min_capacity);
139 reallocate_dynamic(new_capacity);
140 }
141 } else if (min_capacity > N) {
142 switch_to_dynamic(min_capacity);
143 }
144 }
145
146 void reduce_size(size_t reduce_by) {
147 assert(reduce_by <= size_);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected