MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / flush

Method flush

src/flightRecorder.cpp:554–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552 }
553
554 void flush(Buffer* buf) {
555 ssize_t result = write(_in_memory ? _memfd : _fd, buf->data(), buf->offset());
556 if (result > 0) {
557 atomicInc(_bytes_written, (u64)result);
558 }
559 buf->reset();
560 }
561
562 void flushIfNeeded(Buffer* buf, int limit = RECORDING_BUFFER_LIMIT) {
563 if (buf->offset() >= limit) {

Callers

nothing calls this directly

Calls 4

atomicIncFunction · 0.85
dataMethod · 0.45
offsetMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected