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

Method shrink_input_buffer

cpp/fory/util/buffer.h:144–148  ·  view source on GitHub ↗

Best-effort stream buffer compaction entry point. Stage 1 guard: avoid calling into stream shrinking for very small progress. Stage 2 guard lives in InputStream::shrink_buffer(), which can decide based on stream-specific configured buffer size.

Source from the content-addressed store, hash-verified

142 // Stage 2 guard lives in InputStream::shrink_buffer(), which can decide based
143 // on stream-specific configured buffer size.
144 FORY_ALWAYS_INLINE void shrink_input_buffer() {
145 if (FORY_PREDICT_FALSE(input_stream_ != nullptr && reader_index_ > 4096)) {
146 input_stream_->shrink_buffer();
147 }
148 }
149
150 FORY_ALWAYS_INLINE uint32_t writer_index() { return writer_index_; }
151

Callers 4

readMethod · 0.80
read_compatibleMethod · 0.80
read_dataMethod · 0.80
TESTFunction · 0.80

Calls 1

shrink_bufferMethod · 0.45

Tested by 1

TESTFunction · 0.64