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

Method resize

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

Source from the content-addressed store, hash-verified

424 }
425
426 void resize(size_t n) {
427 const size_t old_size = storage_.size_;
428 if (n > storage_.size_) {
429 storage_.bump_size(n - old_size);
430 auto* p = storage_.storage_ptr();
431 for (size_t i = old_size; i < n; ++i) {
432 p[i].construct(T{});
433 }
434 } else {
435 auto* p = storage_.storage_ptr();
436 for (size_t i = n; i < old_size; ++i) {
437 p[i].destroy();
438 }
439 storage_.reduce_size(old_size - n);
440 }
441 }
442
443 void resize(size_t n, const T& value) {
444 const size_t old_size = storage_.size_;

Calls 5

bump_sizeMethod · 0.45
storage_ptrMethod · 0.45
constructMethod · 0.45
destroyMethod · 0.45
reduce_sizeMethod · 0.45

Tested by 15

test_resizeMethod · 0.64
test_resizeMethod · 0.64
test_memory_map_resizeFunction · 0.64
TEST_FFunction · 0.64
ASSERT_OK_AND_ASSIGNFunction · 0.64
MakeDatasetMethod · 0.64
DummyNodeMethod · 0.64
TEST_FFunction · 0.64
MakeCompressibleDataFunction · 0.64
RunCompressedInputStreamFunction · 0.64
SetUpMethod · 0.64