MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / flush_pending

Function flush_pending

zlib/deflate.c:532–549  ·  view source on GitHub ↗

========================================================================= * Flush as much pending output as possible. All deflate() output goes * through this function so some applications may wish to modify it * to avoid allocating a large strm->next_out buffer and copying into it. * (See also read_buf()). */

(strm)

Source from the content-addressed store, hash-verified

530 * (See also read_buf()).
531 */
532local void flush_pending(strm)
533 z_streamp strm;
534{
535 unsigned len = strm->state->pending;
536
537 if (len > strm->avail_out) len = strm->avail_out;
538 if (len == 0) return;
539
540 zmemcpy(strm->next_out, strm->state->pending_out, len);
541 strm->next_out += len;
542 strm->state->pending_out += len;
543 strm->total_out += len;
544 strm->avail_out -= len;
545 strm->state->pending -= len;
546 if (strm->state->pending == 0) {
547 strm->state->pending_out = strm->state->pending_buf;
548 }
549}
550
551/* ========================================================================= */
552int ZEXPORT deflate (strm, flush)

Callers 1

deflateFunction · 0.85

Calls 1

zmemcpyFunction · 0.85

Tested by

no test coverage detected