]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
IBM zSystems DFLTCC: Support inflate with small window
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 20 Oct 2022 00:28:47 +0000 (02:28 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 11 Dec 2022 11:03:12 +0000 (12:03 +0100)
commit3eab3173ac7d1d53457452f3cd1eaeea5b2d43df
tree88697d4ffbfce692b91996389e1659acfb6b0824
parent506b4389f9d82551717b854e6395fb84c5048fe3
IBM zSystems DFLTCC: Support inflate with small window

There is no hardware control for DFLTCC window size, and because of
that supporting small windows for deflate is not trivial: one has to
make sure that DFLTCC does not emit large distances, which most likely
entails somehow trimming the window and/or input in order to make sure
that whave + avail_in <= wsize.

But inflate is much easier: one only has to allocate enough space. Do
that in dfltcc_alloc_window(), and also introduce ZCOPY_WINDOW() in
order to copy everything, not just what the software implementation
cares about.

After this change, software and hardware window formats no longer
match: the software will use wbits and wsize, and the hardware will use
HB_BITS and HB_SIZE. Unlike deflate, inflate does not switch between
software and hardware implementations mid-stream, which leaves only
inflateSetDictionary() and inflateGetDictionary() interesting.
arch/s390/README.md
arch/s390/dfltcc_common.c
arch/s390/dfltcc_common.h
arch/s390/dfltcc_deflate.c
arch/s390/dfltcc_detail.h
arch/s390/dfltcc_inflate.c
arch/s390/dfltcc_inflate.h
inflate.c
inflate_p.h
test/CMakeLists.txt
test/test_small_window.cc [new file with mode: 0644]