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

Method Reallocate

cpp/src/arrow/stl_allocator.h:127–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 Status Reallocate(int64_t old_size, int64_t new_size, int64_t /*alignment*/,
128 uint8_t** ptr) override {
129 uint8_t* old_ptr = *ptr;
130 try {
131 *ptr = alloc_.allocate(new_size);
132 } catch (std::bad_alloc& e) {
133 return Status::OutOfMemory(e.what());
134 }
135 memcpy(*ptr, old_ptr, std::min(old_size, new_size));
136 alloc_.deallocate(old_ptr, old_size);
137 stats_.DidReallocateBytes(old_size, new_size);
138 return Status::OK();
139 }
140
141 void Free(uint8_t* buffer, int64_t size, int64_t /*alignment*/) override {
142 alloc_.deallocate(buffer, size);

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected