zstd/lib/compress
Yann Collet 0d6b8f65a9 ZSTDMT_free() scrubs potentially unfinished jobs to release their resources
In some complex scenarios (free() without finishing compression),
it is possible that some resources are still into jobs
and not collected back into pools.
In which case, previous version of free() would miss them.
This would be equivalent to a leak.

New version ensures that it even foes after such resource.
It requires job consumers to properly mark resources as released,
by replacing entries by NULL after releasing back to the pool.

Obviously, it's not recommended to free() zstdmt context mid-term,
still that's now a supported scenario.

The same methodology is also used to ensure proper resource collection
after an error is detected.

Still to do :
- detect compression errors (not just allocation ones)
- properly manage resource when init() is called without finishing previous compression.
2017-01-17 17:46:33 -08:00
..
fse_compress.c replaced usage of FSE_buildCTable by FSE_buildCTable_wksp, using less stack space in the process 2016-12-01 16:24:04 -08:00
huf_compress.c introduced HUF_buildCTable_wksp(), to reduce stack memory usage 2016-12-01 17:47:30 -08:00
zstd_compress.c zstdmt : correctly check for cctx and buffer allocation 2017-01-12 02:01:28 +01:00
zstd_opt.h fixed g++ warnings 2016-11-23 18:17:18 +01:00
zstdmt_compress.c ZSTDMT_free() scrubs potentially unfinished jobs to release their resources 2017-01-17 17:46:33 -08:00
zstdmt_compress.h zstdmt : changed internal naming from frame to chunk 2017-01-12 01:25:46 +01:00