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.
| 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 |