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

Method AllocateBitmap

cpp/src/arrow/compute/kernel.cc:52–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52Result<std::shared_ptr<ResizableBuffer>> KernelContext::AllocateBitmap(int64_t num_bits) {
53 const int64_t nbytes = bit_util::BytesForBits(num_bits);
54 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<ResizableBuffer> result,
55 AllocateResizableBuffer(nbytes, exec_ctx_->memory_pool()));
56 // Since bitmaps are typically written bit by bit, we could leak uninitialized bits.
57 // Make sure all memory is initialized (this also appeases Valgrind).
58 std::memset(result->mutable_data(), 0, result->size());
59 return result;
60}
61
62Status Kernel::InitAll(KernelContext* ctx, const KernelInitArgs& args,
63 std::vector<std::unique_ptr<KernelState>>* states) {

Callers 14

AllocateDataBufferFunction · 0.80
EnsureAllocatedMethod · 0.80
PrepareOutputMethod · 0.80
ExecMethod · 0.80
ExecIntoArrayDataMethod · 0.80
ExecMethod · 0.80
ExecMethod · 0.80
FinalizeMethod · 0.80
BinaryFilterExecFunction · 0.80
ExecMethod · 0.80

Calls 6

BytesForBitsFunction · 0.85
AllocateResizableBufferFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
memory_poolMethod · 0.45
mutable_dataMethod · 0.45
sizeMethod · 0.45

Tested by 1