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

Method Reallocate

cpp/src/arrow/stl_allocator.h:117–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 }
116
117 Status Reallocate(int64_t old_size, int64_t new_size, int64_t /*alignment*/,
118 uint8_t** ptr) override {
119 uint8_t* old_ptr = *ptr;
120 try {
121 *ptr = alloc_.allocate(new_size);
122 } catch (std::bad_alloc& e) {
123 return Status::OutOfMemory(e.what());
124 }
125 memcpy(*ptr, old_ptr, std::min(old_size, new_size));
126 alloc_.deallocate(old_ptr, old_size);
127 stats_.DidReallocateBytes(old_size, new_size);
128 return Status::OK();
129 }
130
131 void Free(uint8_t* buffer, int64_t size, int64_t /*alignment*/) override {
132 alloc_.deallocate(buffer, size);

Callers

nothing calls this directly

Calls 6

OutOfMemoryFunction · 0.85
allocateMethod · 0.80
whatMethod · 0.80
deallocateMethod · 0.80
DidReallocateBytesMethod · 0.80
OKFunction · 0.70

Tested by

no test coverage detected