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

Method allocate

cpp/src/arrow/stl_allocator.h:64–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 const_pointer address(const_reference r) const noexcept { return std::addressof(r); }
63
64 pointer allocate(size_type n, const void* /*hint*/ = NULLPTR) {
65 uint8_t* data;
66 Status s = pool_->Allocate(n * sizeof(T), &data);
67 if (!s.ok()) throw std::bad_alloc();
68 return reinterpret_cast<pointer>(data);
69 }
70
71 void deallocate(pointer p, size_type n) {
72 pool_->Free(reinterpret_cast<uint8_t*>(p), n * sizeof(T));

Callers 3

AllocateMethod · 0.80
ReallocateMethod · 0.80
TESTFunction · 0.80

Calls 2

AllocateMethod · 0.45
okMethod · 0.45

Tested by 1

TESTFunction · 0.64