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

Function ConcatenateBuffers

cpp/src/arrow/buffer.cc:203–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203Result<std::shared_ptr<Buffer>> ConcatenateBuffers(
204 const std::vector<std::shared_ptr<Buffer>>& buffers, MemoryPool* pool) {
205 int64_t out_length = 0;
206 for (const auto& buffer : buffers) {
207 out_length += buffer->size();
208 }
209 ARROW_ASSIGN_OR_RAISE(auto out, AllocateBuffer(out_length, pool));
210 auto out_data = out->mutable_data();
211 for (const auto& buffer : buffers) {
212 // Passing nullptr to std::memcpy is undefined behavior, so skip empty buffers
213 if (buffer->size() != 0) {
214 std::memcpy(out_data, buffer->data(), buffer->size());
215 out_data += buffer->size();
216 }
217 }
218 return out;
219}
220
221} // namespace arrow

Callers 14

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 9

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