W. Felix Handte
a2af804129
Pull CParam Override Logic into Helper
2020-09-15 13:38:05 -04:00
Yann Collet
c91a0855f8
check endDirective in ZSTD_compressStream2()
...
fix #2297
also :
- `assert()` `endDirective` in `ZSTD_compressStream_internal()`, for debug mode
- add relevant tests
2020-09-14 10:56:08 -07:00
senhuang42
17b56f934e
Coding style cleanup
2020-09-11 11:42:12 -04:00
senhuang42
801513b5e7
Modify params rather than cctx->requestedParams
2020-09-11 11:41:10 -04:00
W. Felix Handte
0faefbf1b3
Make DDSS Selection Override ForceCopy Directive
2020-09-10 22:10:02 -04:00
W. Felix Handte
13c5ec3e41
Only Allow Dedicated Dict Search for Dicts Loaded in 1 Chunk
...
The load algorithm requires we do it all in one go.
2020-09-10 22:10:02 -04:00
W. Felix Handte
07793547e6
Fix Bug: Only Use DDSS Insertion on CDict MatchStates
...
Previously, if DDSS was enabled on a CCtx and a dictionary was inserted into
the CCtx, the CCtx MatchState would be filled as a DDSS struct, causing
segfaults etc. This changes the check to use whether the MatchState is marked
as using the DDSS (which is only ever set for CDict MatchStates), rather than
looking at the CCtxParams.
2020-09-10 18:51:52 -04:00
W. Felix Handte
7b5d2f72ea
Adjust Working Context Table Sizes Back Down
2020-09-10 18:51:52 -04:00
W. Felix Handte
a3659fe1ef
Make ZSTD_dedicatedDictSearch_getCParams Wrap ZSTD_getCParams
...
Fixes up bounds-checking, and lets us clean up what is at the moment an
unnecessary duplication of the default cparams tables.
2020-09-10 18:51:52 -04:00
W. Felix Handte
5390fee4f7
Rename and Move DD_BLOG Constant to ZSTD_LAZY_DDSS_BUCKET_LOG
2020-09-10 18:51:52 -04:00
W. Felix Handte
914bfe7ee4
Init CCtx's Local Dict with CCtxParams
2020-09-10 18:51:52 -04:00
W. Felix Handte
db2aa25252
Decision for Whether to Attach Should be Based on CDict Config, not CCtx
2020-09-10 18:51:52 -04:00
W. Felix Handte
f1b428fdac
Rename enableDedicatedDictSearch to dedicatedDictSearch in MatchState
...
This makes it clear that not only is the feature allowed here, we're actually
using it, as opposed to the CCtxParam field, in which it's enabled, but we may
or may not be using it.
2020-09-10 18:51:52 -04:00
W. Felix Handte
41012193ad
Always Init CDict's enableDedicatedDictSearch Field
2020-09-10 18:51:52 -04:00
W. Felix Handte
34b545acb0
Add a ZSTD_dedicatedDictSearch ZSTD_dictMode_e to Allow Const Propagation
...
Speed +1.5%.
2020-09-10 18:51:52 -04:00
W. Felix Handte
beefdb0d3d
Fix ZSTD_c_forceAttachDict Bounds
2020-09-10 18:51:52 -04:00
W. Felix Handte
def62e2d3e
Fix Compilation Warnings
2020-09-10 18:51:52 -04:00
Bimba Shrestha
9c628238d3
creating ZSTD_createCDict_advanced_internal
2020-09-10 18:51:52 -04:00
Bimba Shrestha
0a9787c3e1
changing to int for consistency
2020-09-10 18:51:52 -04:00
Bimba Shrestha
5d5507788d
change method name for consistency
2020-09-10 18:51:52 -04:00
Bimba Shrestha
b30f71becf
pass correct cparams
2020-09-10 18:51:52 -04:00
Bimba Shrestha
71fda0362f
making cctxParams a pointer
2020-09-10 18:51:52 -04:00
Bimba Shrestha
628559d0e4
loading dict using new algorithm
2020-09-10 18:51:52 -04:00
Bimba Shrestha
31e581bf65
adding enableDedicatedDictSearch to matchState_t
2020-09-10 18:51:52 -04:00
Bimba Shrestha
75b6360036
adding ZSTD_createCDict_advanced2 to zstd.h
2020-09-10 18:51:52 -04:00
Bimba Shrestha
b7dddbe89b
always attach dict when using dedicatedDictSearch
2020-09-10 18:51:52 -04:00
Bimba Shrestha
e36a373df4
adding dedicatedDictSearch cParams helper methods
2020-09-10 18:51:52 -04:00
Bimba Shrestha
f10d4e313c
adding ZSTD_dedicatedDictSearch_defaultCParameters variable
2020-09-10 18:51:52 -04:00
Bimba Shrestha
c497cb6716
Add ZSTD_c_enableDedicatedDictSearch Param
2020-09-10 18:51:52 -04:00
senhuang42
64bd68e44b
Adjust ZSTD_createCDict_byReference() function, and check for cdict when using compressStream2
2020-09-10 13:42:26 -04:00
Nick Terrell
a90779397a
[lib] Reduce zstd stack usage by 1KB
2020-09-09 14:35:39 -07:00
Nick Terrell
046aca190f
Fix ZSTD_initCStream_advanced() with no dictionary and static allocation
2020-09-09 14:35:39 -07:00
Nick Terrell
f91ed5c766
[lib] s/current/curr because it collides with Linux Kernel macro
2020-09-09 14:35:39 -07:00
Nick Terrell
5e4efd22d4
Merge pull request #2291 from i-do-cpp/fix-compression-level-default
...
Fix setParameter not falling back to default compression level
2020-09-08 16:42:34 -07:00
Nick Terrell
6da8acd231
Merge pull request #2293 from allanjude/coverity
...
Resolve Coverity 1432392 Unintentional integer overflow
2020-09-03 13:58:45 -07:00
Allan Jude
8665793164
Resolve Coverity 1432392 Unintentional integer overflow
...
Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression:
cdict->dictContentSize * 6U
with type unsigned int (32 bits, unsigned) is evaluated using 32-bit
arithmetic, and then used in a context that expects an expression of
type U64 (64 bits, unsigned).
2020-09-03 19:31:50 +00:00
i-do-cpp
aec8b27fff
Update zstd_compress.c
2020-08-31 09:34:08 +02:00
i-do-cpp
d514281e73
Fix setParameter not falling back to default compression level on 0 value
...
See documentation for `ZSTD_c_compressionLevel`: `Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT`
2020-08-31 09:25:43 +02:00
Nick Terrell
c465f24457
ZSTD_ prefix mem{cpy,move,set},malloc,calloc,free
2020-08-26 12:26:03 -07:00
Nick Terrell
a686d306d2
Rename ZSTD_{malloc,calloc,free} to ZSTD_custom{Malloc,Calloc,Free}
2020-08-26 12:25:08 -07:00
Nick Terrell
80f577baa2
Move standard includes to zstd_deps.h
2020-08-26 12:25:08 -07:00
Nick Terrell
08981d2638
[lib] Allow compression dictionaries with missing symbols
...
Allow compression to use dictionaries with missing symbols in their
entropy tables. We set the FSE repeat mode to check when there are
missing symbols, and set the FSE repeat mode to valid when all symbols
are present.
Note that when not all symbols are present, the heuristics which favor
dictionary tables for lower compression levels won't activate.
Tested by manually creating a dictionary with missing symbols of every
type, and validing that the compressor rejects it before this change,
and accepts it after this change. Also, I ran the `dictionary_loader`
fuzzer for >1 hour of CPU time without running into cases where
compression succeeds, but decompression fails.
Fixes #2174 .
2020-06-12 17:57:19 -07:00
Felix Handte
2af4e07326
Merge pull request #2133 from felixhandte/single-size-calculation
...
Consolidate CCtx Size Estimation Code
2020-05-28 13:07:18 -04:00
Nick Terrell
b2092c6dc4
[ldm] Reset loadedDictEnd when the context is reset
2020-05-18 12:35:44 -07:00
Nick Terrell
add7ed2d4a
[lib] Fix bug in loading LDM dictionary in MT mode
...
Exposed when loading a dictionary < LDM minMatch bytes in MT mode.
Test Plan:
```
CC=clang make -j zstreamtest MOREFLAGS="-O0 -fsanitize=address"
./zstreamtest -vv -i100000000 -t1 --newapi -s7065 -t3925297
```
TODO: Add an explicit test that loads a small dictionary in MT mode
2020-05-14 11:52:28 -07:00
W. Felix Handte
3bb7992350
Fix Size Estimate for LDM Seq Space
2020-05-14 13:50:53 -04:00
Nick Terrell
c3e921c639
Merge pull request #2131 from terrelln/raw-dict-fuzzer
...
Fix rare scenario with lazy parser, dictionary, and repcodes
2020-05-12 17:44:31 -07:00
W. Felix Handte
d9a1e37aec
Nit: Fix Size Type for 32-bit
2020-05-12 18:03:31 -04:00
W. Felix Handte
1aa6c7ccce
Assert We Allocated Approximately What We Expected To
2020-05-12 16:55:03 -04:00
W. Felix Handte
27e2482217
Minor Refactor
2020-05-12 16:55:03 -04:00