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

Function AllocateValuesBuffer

cpp/src/arrow/compute/kernels/ree_util_internal.cc:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace ree_util {
34
35Result<std::shared_ptr<Buffer>> AllocateValuesBuffer(int64_t length, const DataType& type,
36 MemoryPool* pool,
37 int64_t data_buffer_size) {
38 if (type.bit_width() == 1) {
39 // Make sure the bitmap is initialized (avoids Valgrind errors).
40 return AllocateEmptyBitmap(length, pool);
41 } else if (is_fixed_width(type.id())) {
42 return AllocateBuffer(length * type.byte_width(), pool);
43 } else {
44 DCHECK(is_base_binary_like(type.id()));
45 return AllocateBuffer(data_buffer_size, pool);
46 }
47}
48
49Result<std::shared_ptr<ArrayData>> PreallocateRunEndsArray(
50 const std::shared_ptr<DataType>& run_end_type, int64_t physical_length,

Callers

nothing calls this directly

Calls 7

AllocateEmptyBitmapFunction · 0.85
is_fixed_widthFunction · 0.85
is_base_binary_likeFunction · 0.85
AllocateBufferFunction · 0.50
bit_widthMethod · 0.45
idMethod · 0.45
byte_widthMethod · 0.45

Tested by

no test coverage detected