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

Method ResetBuffer

cpp/src/arrow/io/buffered.cc:55–65  ·  view source on GitHub ↗

Allocate buffer_ if needed, and resize it to buffer_size_ if required.

Source from the content-addressed store, hash-verified

53
54 // Allocate buffer_ if needed, and resize it to buffer_size_ if required.
55 Status ResetBuffer() {
56 if (!buffer_) {
57 // On first invocation, or if the buffer has been released, we allocate a
58 // new buffer
59 ARROW_ASSIGN_OR_RAISE(buffer_, AllocateResizableBuffer(buffer_size_, pool_));
60 } else if (buffer_->size() != buffer_size_) {
61 RETURN_NOT_OK(buffer_->Resize(buffer_size_));
62 }
63 buffer_data_ = buffer_->mutable_data();
64 return Status::OK();
65 }
66
67 Status ResizeBuffer(int64_t new_buffer_size) {
68 buffer_size_ = new_buffer_size;

Callers

nothing calls this directly

Calls 6

AllocateResizableBufferFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45
ResizeMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected