From 0d32b6cb474bcbbe7a180a45b4d1462d5ffbf770 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 26 Oct 2017 12:34:01 +1100 Subject: [PATCH] Add a mark call to zlib_decoder.decode. --- gen/c/std/flate.c | 1 + std/flate/decode_zlib.puffs | 1 + 2 files changed, 2 insertions(+) diff --git a/gen/c/std/flate.c b/gen/c/std/flate.c index 40fb91af..3b3e0f3c 100644 --- a/gen/c/std/flate.c +++ b/gen/c/std/flate.c @@ -2422,6 +2422,7 @@ puffs_flate__status puffs_flate__zlib_decoder__decode( } v_checksum = 0; while (true) { + puffs_base__writer1__mark(&a_dst, b_wptr_dst); PUFFS_BASE__COROUTINE_SUSPENSION_POINT(3); if (a_dst.buf) { size_t n = b_wptr_dst - (a_dst.buf->ptr + a_dst.buf->wi); diff --git a/std/flate/decode_zlib.puffs b/std/flate/decode_zlib.puffs index 5788ff7e..3ec97a71 100644 --- a/std/flate/decode_zlib.puffs +++ b/std/flate/decode_zlib.puffs @@ -46,6 +46,7 @@ pub func zlib_decoder.decode?(dst writer1, src reader1)() { } var checksum u32 while true { + in.dst.mark() var z status = try this.flate.decode?(dst:in.dst, src:in.src) // TODO: expose some API to opt out of checksumming, trading off error // detection for throughput.