zstd/lib/compress
Yann Collet 05dffe43a7 Fixed Btree update
ZSTD_updateTree() expected to be followed by a Bt match finder, which would update zc->nextToUpdate.
With the new optimal match finder, it's not necessarily the case : a match might be found during repcode or hash3, and stops there because it reaches sufficient_len, without even entering the binary tree.
Previous policy was to nonetheless update zc->nextToUpdate, but the current position would not be inserted, creating "holes" in the btree, aka positions that will no longer be searched.
Now, when current position is not inserted, zc->nextToUpdate is not update, expecting ZSTD_updateTree() to fill the tree later on.

Solution selected is that ZSTD_updateTree() takes care of properly setting zc->nextToUpdate,
so that it no longer depends on a future function to do this job.

It took time to get there, as the issue started with a memory sanitizer error.
The pb would have been easier to spot with a proper `assert()`.
So this patch add a few of them.

Additionnally, I discovered that `make test` does not enable `assert()` during CLI tests.
This patch enables them.

Unfortunately, these `assert()` triggered other (unrelated) bugs during CLI tests, mostly within zstdmt.
So this patch also fixes them.

- Changed packed structure for gcc memory access : memory sanitizer would complain that a read "might" reach out-of-bound position on the ground that the `union` is larger than the type accessed.
  Now, to avoid this issue, each type is independent.
- ZSTD_CCtxParams_setParameter() : @return provides the value of parameter, clamped/fixed appropriately.
- ZSTDMT : changed constant name to ZSTDMT_JOBSIZE_MIN
- ZSTDMT : multithreading is automatically disabled when srcSize <= ZSTDMT_JOBSIZE_MIN, since only one thread will be used in this case (saves memory and runtime).
- ZSTDMT : nbThreads is automatically clamped on setting the value.
2017-11-16 12:18:56 -08:00
..
fse_compress.c [zstd] Backport kernel patch from @ColinIanKing 2017-09-25 16:18:23 -07:00
huf_compress.c Ensure dictionary Huff table can encode any symbol 2017-10-03 13:22:13 -07:00
zstd_compress_internal.h Fixed Btree update 2017-11-16 12:18:56 -08:00
zstd_compress.c Fixed Btree update 2017-11-16 12:18:56 -08:00
zstd_double_fast.c renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstd_double_fast.h renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstd_fast.c renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstd_fast.h renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstd_lazy.c Fixed Btree update 2017-11-16 12:18:56 -08:00
zstd_lazy.h renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstd_ldm.c Increase maximum window size 2017-09-26 14:00:01 -07:00
zstd_ldm.h renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstd_opt.c Fixed Btree update 2017-11-16 12:18:56 -08:00
zstd_opt.h renamed zstd_compress.h into zstd_compress_internal.h 2017-11-07 16:15:23 -08:00
zstdmt_compress.c Fixed Btree update 2017-11-16 12:18:56 -08:00
zstdmt_compress.h Fixed Btree update 2017-11-16 12:18:56 -08:00