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

Method allocate

cpp/src/arrow/stl_allocator.h:74–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 const_pointer address(const_reference r) const noexcept { return std::addressof(r); }
73
74 pointer allocate(size_type n, const void* /*hint*/ = NULLPTR) {
75 uint8_t* data;
76 Status s = pool_->Allocate(n * sizeof(T), &data);
77 if (!s.ok()) throw BadAlloc(std::move(s));
78 return reinterpret_cast<pointer>(data);
79 }
80
81 void deallocate(pointer p, size_type n) {
82 pool_->Free(reinterpret_cast<uint8_t*>(p), n * sizeof(T));

Callers 3

AllocateMethod · 0.80
ReallocateMethod · 0.80
TESTFunction · 0.80

Calls 3

BadAllocClass · 0.85
AllocateMethod · 0.45
okMethod · 0.45

Tested by 1

TESTFunction · 0.64