mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 00:52:18 +01:00
Add comment about set_limit subtleties
This commit is contained in:
1 parent
daecfc08b1
commit
84724a76a2
1 file changed
+6
@@ -336,6 +336,12 @@ pri func decoder.decode_id?(dst base.io_writer, src base.io_reader)() {
|
|||||||
while true {
|
while true {
|
||||||
in.src.set_mark()
|
in.src.set_mark()
|
||||||
io_bind (in.src) {
|
io_bind (in.src) {
|
||||||
|
// TODO: enforce that calling r.set_limit has a precondition
|
||||||
|
// that r.is_bound(), and that you can't suspend inside an
|
||||||
|
// io_bind? Otherwise, the cgen implementation becomes more
|
||||||
|
// complicated if we must save and re-apply limits.
|
||||||
|
//
|
||||||
|
// Should calling r.set_mark also require r.is_bound()?
|
||||||
in.src.set_limit(l:block_size)
|
in.src.set_limit(l:block_size)
|
||||||
var z base.status = try this.lzw.decode?(dst:in.dst, src:in.src)
|
var z base.status = try this.lzw.decode?(dst:in.dst, src:in.src)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user