]> git.ipfire.org Git - thirdparty/zstd.git/commit
[lib] Always load the dictionary in one go
authorNick Terrell <terrelln@fb.com>
Tue, 4 May 2021 05:33:22 +0000 (22:33 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 4 May 2021 23:45:25 +0000 (16:45 -0700)
commit94db4398a02765024be6a85f4bd7ada472b1ce8e
tree78e50bb713d67c7e28a96fb36b2f05401039e0a3
parent8a8899fc08250d4527436464a7a02be38cac8c76
[lib] Always load the dictionary in one go

Dictionaries larger than `ZSTD_CHUNKSIZE_MAX` used to have to be loaded
in multiple segments. Instead, when we detect large dictionaries, ensure
that we reset the context's indicies. Then, for dictionaries larger than
`ZSTD_CURRENT_MAX - 1`, only load the suffix of the dictionary. Finally,
enable DDS for large dictionaries, since we no longer load in multiple
segments.

This simplifes the dictionary loading code, and reduces opportunities
for non-determinism to slip in.
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h