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

Function ConcatenateBuffers

cpp/src/arrow/buffer.cc:194–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194Result<std::shared_ptr<Buffer>> ConcatenateBuffers(
195 const std::vector<std::shared_ptr<Buffer>>& buffers, MemoryPool* pool) {
196 int64_t out_length = 0;
197 for (const auto& buffer : buffers) {
198 out_length += buffer->size();
199 }
200 ARROW_ASSIGN_OR_RAISE(auto out, AllocateBuffer(out_length, pool));
201 auto out_data = out->mutable_data();
202 for (const auto& buffer : buffers) {
203 // Passing nullptr to std::memcpy is undefined behavior, so skip empty buffers
204 if (buffer->size() != 0) {
205 std::memcpy(out_data, buffer->data(), buffer->size());
206 out_data += buffer->size();
207 }
208 }
209 return out;
210}
211
212} // namespace arrow

Callers 15

TEST_PFunction · 0.85
AccumulateReadsMethod · 0.85
TESTFunction · 0.85
joinFunction · 0.85
AssertChunkingBlockSizeFunction · 0.85
AssertStraddledChunkingFunction · 0.85
ParseBlockFunction · 0.85
VisitMethod · 0.85
ConcatenateMessageMethod · 0.85
operator()Method · 0.85
TESTFunction · 0.85

Calls 3

sizeMethod · 0.45
mutable_dataMethod · 0.45
dataMethod · 0.45

Tested by 10

TEST_PFunction · 0.68
AccumulateReadsMethod · 0.68
TESTFunction · 0.68
joinFunction · 0.68
AssertChunkingBlockSizeFunction · 0.68
AssertStraddledChunkingFunction · 0.68
ConcatenateMessageMethod · 0.68
TESTFunction · 0.68
TEST_FFunction · 0.68