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

Function AllocateDataBuffer

cpp/src/arrow/compute/exec.cc:268–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266namespace {
267
268Result<std::shared_ptr<Buffer>> AllocateDataBuffer(KernelContext* ctx, int64_t length,
269 int bit_width) {
270 if (bit_width == 1) {
271 return ctx->AllocateBitmap(length);
272 } else {
273 int64_t buffer_size = bit_util::BytesForBits(length * bit_width);
274 return ctx->Allocate(buffer_size);
275 }
276}
277
278struct BufferPreallocation {
279 explicit BufferPreallocation(int bit_width = -1, int added_length = 0)

Callers 1

PrepareOutputMethod · 0.85

Calls 3

BytesForBitsFunction · 0.85
AllocateBitmapMethod · 0.80
AllocateMethod · 0.45

Tested by

no test coverage detected