]> git.ipfire.org Git - thirdparty/zstd.git/commit
removed ZSTD_decompressBegin() from ZSTD_initDCtx_internal()
authorYann Collet <cyan@fb.com>
Wed, 27 Sep 2017 20:51:05 +0000 (13:51 -0700)
committerYann Collet <cyan@fb.com>
Wed, 27 Sep 2017 20:51:05 +0000 (13:51 -0700)
commitea1f50bf73a1f49bacfd4603e1e86d5bc0b9f31f
tree223225095911c1a06ffe8869814d6903d842ca77
parentc9949327883968153470809d1e55b3d954b685f5
removed ZSTD_decompressBegin() from ZSTD_initDCtx_internal()

It does not feel "right" from a dependency perspective.
ZSTD_initDCtx_internal() is triggered once, on DCtx creation,
while ZSTD_decompressBegin() is invoked at the beginning of each new frame,
and is also a user-facing prototype.

Downside : a DCtx must be init before first usage !
This was always the intention by the way, and is documented as such.
This stage is automatically done within ZSTD_decompress() and variants,
and also within ZSTD_decompressStream().
Only ZSTD_decompressContinue() is impacted,
it must be preceded by a ZSTD_decompressBegin(), as detailed in doc.

A test has been fixed, to no longer rely on undocumented assumption that ZSTD_decompressBegin() is invoked during init.
lib/decompress/zstd_decompress.c
tests/fullbench.c