]> git.ipfire.org Git - thirdparty/zstd.git/commit
Fix required decompression memory usage reported by -vv + --long 3042/head
authorJonathan McDowell <noodles@fb.com>
Tue, 1 Feb 2022 11:20:30 +0000 (03:20 -0800)
committerJonathan McDowell <noodles@fb.com>
Wed, 2 Feb 2022 12:39:27 +0000 (12:39 +0000)
commit470eb8330a9821c334df7efe66945a63d1faf017
tree003479050e8e0c2480e3b2a251a7204671b5f6da
parent4b24ebdcf33cc5c2819272278e2d742b9d0f72fe
Fix required decompression memory usage reported by -vv + --long

The use of --long alters the window size internally in the underlying
library (lib/compress/zstd_compress.c:ZSTD_getCParamsFromCCtxParams),
which changes the memory required for decompression. This means that the
reported requirement from the zstd binary when -vv is specified is
incorrect.

A full fix for this would be to add an API call to be able to retrieve
the required decompression memory from the library, but as a
lighterweight fix we can just take account of the fact we've enabled
long mode and update our verbose output appropriately.

Fixes #2968
programs/fileio.c