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

Function AllocateDeallocate

cpp/src/arrow/memory_pool_benchmark.cc:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85// temporary buffers for intermediate computation results.
86template <typename Alloc>
87static void AllocateDeallocate(benchmark::State& state) { // NOLINT non-const reference
88 const int64_t nbytes = state.range(0);
89 MemoryPool* pool = *Alloc::GetAllocator();
90
91 for (auto _ : state) {
92 uint8_t* data;
93 ARROW_CHECK_OK(pool->Allocate(nbytes, &data));
94 pool->Free(data, nbytes);
95 }
96 state.SetItemsProcessed(state.iterations());
97 // SetBytesProcessed() would give nonsensical figures since the data is not
98 // actually processed.
99}
100
101// Benchmark the cost of allocating memory plus accessing it.
102template <typename Alloc>

Callers

nothing calls this directly

Calls 2

AllocateMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected