]> git.ipfire.org Git - thirdparty/zstd.git/commit
External matchfinder API (#3333)
authorElliot Gorokhovsky <embg@fb.com>
Wed, 28 Dec 2022 21:45:14 +0000 (16:45 -0500)
committerGitHub <noreply@github.com>
Wed, 28 Dec 2022 21:45:14 +0000 (16:45 -0500)
commit2a402626dd046bf17e6172fe8d829ed5a443fbe3
tree36a08bd76202da60b0a2e14bff6392876a53e8ce
parent90597d78eadadae7acf3633ab4d81ef7c4e6057f
External matchfinder API (#3333)

* First building commit with sample matchfinder

* Set up ZSTD_externalMatchCtx struct

* move seqBuffer to ZSTD_Sequence*

* support non-contiguous dictionary

* clean up parens

* add clearExternalMatchfinder, handle allocation errors

* Add useExternalMatchfinder cParam

* validate useExternalMatchfinder cParam

* Disable LDM + external matchfinder

* Check for static CCtx

* Validate mState and mStateDestructor

* Improve LDM check to cover both branches

* Error API with optional fallback

* handle RLE properly for external matchfinder

* nit

* Move to a CDict-like model for resource ownership

* Add hidden useExternalMatchfinder bool to CCtx_params_s

* Eliminate malloc, move to cwksp allocation

* Handle CCtx reset properly

* Ensure seqStore has enough space for external sequences

* fix capitalization

* Add DEBUGLOG statements

* Add compressionLevel param to matchfinder API

* fix c99 issues and add a param combination error code

* nits

* Test external matchfinder API

* C90 compat for simpleExternalMatchFinder

* Fix some @nocommits and an ASAN bug

* nit

* nit

* nits

* forward declare copySequencesToSeqStore functions in zstd_compress_internal.h

* nit

* nit

* nits

* Update copyright headers

* Fix CMake zstreamtest build

* Fix copyright headers (again)

* typo

* Add externalMatchfinder demo program to make contrib

* Reduce memory consumption for small blockSize

* ZSTD_postProcessExternalMatchFinderResult nits

* test sum(matchlen) + sum(litlen) == srcSize in debug builds

* refExternalMatchFinder -> registerExternalMatchFinder

* C90 nit

* zstreamtest nits

* contrib nits

* contrib nits

* allow block splitter + external matchfinder, refactor

* add windowSize param

* add contrib/externalMatchfinder/README.md

* docs

* go back to old RLE heuristic because of the first block issue

* fix initializer element is not a constant expression

* ref contrib from zstd.h

* extremely pedantic compiler warning fix, meson fix, typo fix

* Additional docs on API limitations

* minor nits

* Refactor maxNbSeq calculation into a helper function

* Fix copyright
18 files changed:
Makefile
build/cmake/tests/CMakeLists.txt
build/meson/tests/meson.build
contrib/externalMatchfinder/.gitignore [new file with mode: 0644]
contrib/externalMatchfinder/Makefile [new file with mode: 0644]
contrib/externalMatchfinder/README.md [new file with mode: 0644]
contrib/externalMatchfinder/main.c [new file with mode: 0644]
contrib/externalMatchfinder/matchfinder.c [new file with mode: 0644]
contrib/externalMatchfinder/matchfinder.h [new file with mode: 0644]
lib/common/error_private.c
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/zstd.h
lib/zstd_errors.h
tests/Makefile
tests/external_matchfinder.c [new file with mode: 0644]
tests/external_matchfinder.h [new file with mode: 0644]
tests/zstreamtest.c