MCPcopy Create free account
hub / github.com/apache/fory / bind_buffer

Method bind_buffer

cpp/fory/util/stream.cc:63–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void OutputStream::bind_buffer(Buffer *buffer) {
64 Buffer *next = buffer == nullptr ? buffer_.get() : buffer;
65 if (active_buffer_ == next) {
66 return;
67 }
68 if (active_buffer_ != nullptr && active_buffer_ != buffer_.get()) {
69 // Rebinding must detach the previous external buffer to avoid stale
70 // backlinks that can trigger misdirected flushes and dangling pointers.
71 active_buffer_->output_stream_ = nullptr;
72 }
73 active_buffer_ = next;
74}
75
76void OutputStream::unbind_buffer(Buffer *buffer) {
77 if (active_buffer_ == buffer) {

Callers 4

BufferMethod · 0.45
bind_output_streamMethod · 0.45

Calls 2

getMethod · 0.65
dataMethod · 0.45

Tested by

no test coverage detected