]> git.ipfire.org Git - thirdparty/zstd.git/commit
[lib] Avoid allocating the input buffer when ZSTD_c_stableInBuffer is set
authorNick Terrell <terrelln@fb.com>
Mon, 12 Oct 2020 21:47:55 +0000 (14:47 -0700)
committerNick Terrell <terrelln@fb.com>
Fri, 30 Oct 2020 17:55:34 +0000 (10:55 -0700)
commitd4e021fe35ef6b24079c736e7b22fdce225e14e0
treee2b0d39924791a5cf687254457a5b357902dc250
parent24f72789e2ad51b78bc9f6904d4ab7312edf211b
[lib] Avoid allocating the input buffer when ZSTD_c_stableInBuffer is set

We don't use it when we have a stable input buffer, so don't allocate
it. I had to slightly modify `ZSTD_copyCCtx()` by storing the
`ZSTD_buffered_policy_e` in the `ZSTD_CCtx`, since `inBuffSize > 0` is
no longer the correct signal for the buffered mode.
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h