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

Method try_flush

cpp/fory/util/stream.h:49–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 FORY_ALWAYS_INLINE void exit_flush_barrier() { flush_barrier_depth_--; }
48
49 FORY_ALWAYS_INLINE bool try_flush() {
50 if (FORY_PREDICT_FALSE(flush_barrier_depth_ != 0)) {
51 return false;
52 }
53 const uint32_t bytes_before_flush = active_buffer_writer_index();
54 if (FORY_PREDICT_FALSE(bytes_before_flush <= 4096)) {
55 return false;
56 }
57 flush_buffer_data();
58 if (FORY_PREDICT_FALSE(!error_.ok())) {
59 return false;
60 }
61 return bytes_before_flush != 0;
62 }
63
64 FORY_ALWAYS_INLINE void force_flush() {
65 if (FORY_PREDICT_FALSE(!error_.ok())) {

Callers 2

write_bytesMethod · 0.45
TESTFunction · 0.45

Calls 1

okMethod · 0.45

Tested by 1

TESTFunction · 0.36