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

Method ExpandIntSizeInternal

cpp/src/arrow/array/builder_adaptive.cc:73–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72template <typename new_type, typename old_type>
73typename std::enable_if<(sizeof(old_type) < sizeof(new_type)), Status>::type
74AdaptiveIntBuilderBase::ExpandIntSizeInternal() {
75 int_size_ = sizeof(new_type);
76 RETURN_NOT_OK(Resize(data_->size() / sizeof(old_type)));
77
78 const old_type* src = reinterpret_cast<old_type*>(raw_data_);
79 new_type* dst = reinterpret_cast<new_type*>(raw_data_);
80 // By doing the backward copy, we ensure that no element is overridden during
81 // the copy process while the copy stays in-place.
82 std::copy_backward(src, src + length_, dst + length_);
83
84 return Status::OK();
85}
86
87std::shared_ptr<DataType> AdaptiveUIntBuilder::type() const {
88 auto int_size = int_size_;

Callers

nothing calls this directly

Calls 3

ResizeFunction · 0.70
OKFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected