]> git.ipfire.org Git - thirdparty/zstd.git/commit
Consolidate CCtx Size Estimation Code
authorW. Felix Handte <w@felixhandte.com>
Tue, 12 May 2020 18:18:23 +0000 (14:18 -0400)
committerW. Felix Handte <w@felixhandte.com>
Tue, 12 May 2020 20:26:53 +0000 (16:26 -0400)
commit7ed996f5a0eef6168b92369fb5796d30c9d362b6
treeb7987df4c65e4e5f55fdd010c6b4c6079c7ecba7
parente7d2391e9a75154657183b049b69a7a2effa9724
Consolidate CCtx Size Estimation Code

This commit pulls out the internals of `ZSTD_estimateCCtxSize_usingCCtxParams`
into a helper. It then migrates two other callsites to use that helper,
a small optimization for `ZSTD_estimateCStreamSize_usingCCtxParams`, which
folds the buffer sizing into the helper, and then `ZSTD_resetCCtx_internal`,
which is more invasive.

This attempts to guarantee that the estimates returned to users are always
correct.
lib/compress/zstd_compress.c