Refactor compress.Context struct.

This commit is contained in:
Jeroen van Rijn
2021-06-26 22:25:55 +02:00
parent 30a5808460
commit 4689a6b341
3 changed files with 17 additions and 13 deletions
+3 -2
View File
@@ -430,8 +430,7 @@ inflate_from_stream :: proc(using ctx: ^Context, raw := false, expected_output_s
- read
- size
ctx.output must be an io.Stream backed by an implementation that supports:
- write
ctx.output must be a bytes.Buffer for now. We'll add a separate implementation that writes to a stream.
raw determines whether the ZLIB header is processed, or we're inflating a raw
DEFLATE stream.
@@ -499,6 +498,8 @@ inflate_from_stream :: proc(using ctx: ^Context, raw := false, expected_output_s
return nil;
}
// TODO: Check alignment of reserve/resize.
@(optimization_mode="speed")
inflate_from_stream_raw :: proc(z: ^Context, expected_output_size := -1, allocator := context.allocator) -> (err: Error) #no_bounds_check {
expected_output_size := expected_output_size;