Yann Collet
5bcef1ada2
removed mtctx->cstream
...
use the first cctx in pool when ZSTDMT is used in single-thread mode
now that cctx and cstream are the same object.
2017-05-30 16:37:19 -07:00
Yann Collet
beb62b15a8
Merge branch 'dev' into advancedAPI2
...
Fixed conflic in zstd_decompress.c
2017-05-30 16:18:57 -07:00
Yann Collet
44e45e8423
added ZSTDMT_createCCtx_advanced()
...
make it possible to use custom allocators
2017-05-30 16:12:06 -07:00
Yann Collet
f45ca527a1
Merge branch 'advancedAPI2' of github.com:facebook/zstd into advancedAPI2
2017-05-30 10:02:03 -07:00
Yann Collet
b6dec4c3ae
fixed minor cast warning
2017-05-27 17:09:06 -07:00
Yann Collet
e071159101
mtctx->jobs allocate its own memory space
...
to make ZSTDMT_CCtx_s size predictable
so that it can be included in CCtx
2017-05-27 00:21:33 -07:00
Yann Collet
b8136f019a
static dctx is incompatible with legacy support
...
documented, and runtime tested
2017-05-27 00:03:08 -07:00
Yann Collet
7028cbd7fd
fixed a few code comments : ZSTD_getFrameParams => ZSTD_getFrameHeader
2017-05-25 18:29:08 -07:00
Yann Collet
cdf7e82222
Added ZSTD_initStaticCDict()
2017-05-25 18:05:49 -07:00
Dmitry V. Levin
1ea655c765
Fix typo in libzstd.a-mt make rules
...
The macro name is ZSTD_MULTITHREAD, not ZSTD_MULTHREAD.
Fixes: ca6fae7808
("Add MT enabled targets for libzstd")
2017-05-25 23:43:05 +00:00
Yann Collet
57827f906f
added ZSTD_initStaticDDict()
2017-05-25 15:44:06 -07:00
Yann Collet
25989e361c
updated ZSTD_estimate?DictSize() to pass parameter byReference
...
resulting ?Dict object is smaller when created byReference.
Seems better than a documentation note.
2017-05-25 15:07:37 -07:00
Yann Collet
0fdc71c3dc
added ZSTD_initStaticDCtx()
2017-05-24 17:41:41 -07:00
Yann Collet
ba183005d3
merged DStream's inBuff and outBuff into a single buffer
...
Saves one malloc().
Also : makes it easier to implement static allocation
2017-05-24 15:42:24 -07:00
Nick Terrell
55fc1f91fd
[zstd] Fix up formatting edge cases for clang-format
2017-05-24 13:50:10 -07:00
Yann Collet
2e4db3e531
fixed performance regression with ZSTD_decompress() on small files
...
memset() was a quick fix to initialization problems,
but initialize too much space (tables, buffers)
which show up in decompression speed of ZSTD_decompress()
since it needs to recreate DCtx at each invocation.
Fixed by only initialization relevant pointers and size fields.
2017-05-24 13:15:19 -07:00
Yann Collet
11ea2f7fda
Merged ZSTD_DCtx and ZSTD_DStream objects
...
They are now the same object.
It's recommended to keep both types in source code
as previous versions of library (<v1.3.0)
still need this differentiation.
2017-05-23 16:19:43 -07:00
Yann Collet
b81f19ffce
move MEM_readMINMATCH() into zstd_opt.h
...
which is its only user.
Use case too narrow to belong to mem.h.
renamed to ZSTD_readMINMATCH()
2017-05-23 15:41:55 -07:00
Yann Collet
c7fe262dc9
added ZSTD_initStaticCCtx()
...
makes it possible to statically or externally allocate CCtx.
static CCtx will only use provided memory area,
it will never resize nor malloc.
2017-05-23 13:20:41 -07:00
Yann Collet
5ac72b417c
Buffered are now allocated inside workSpace
2017-05-23 11:18:24 -07:00
Yann Collet
1880337c30
Simplifier compression call graph
...
Everything converge towards ZSTD_compressBegin_internal
which delegated to ZSTD_copyCCtx_internal if cdict!=NULL.
This simplifies routing which was previously depending on cdict.
2017-05-22 18:21:51 -07:00
Yann Collet
b0739bcf8f
simplified reset by removing full-reset policy
...
this was meant to be applied prior to dictionary loading.
But effectively, it seems redundant with later loading stage,
so it can be skipped safely.
2017-05-22 17:45:15 -07:00
Yann Collet
1ad7c82eb5
Implemented separation between requested and applied parameters
...
first version to pass cli tests with -DZSTD_NEWAPI
2017-05-22 17:06:04 -07:00
Yann Collet
24de7b0346
Implemented ZSTD_CCtx_refCDict()
2017-05-22 13:05:45 -07:00
Yann Collet
ee970398b2
Merge branch 'dev' into advancedAPI2
2017-05-22 12:33:56 -07:00
Yann Collet
8b21ec42a9
ZSTD_compress_generic() can handle dictionary compression
2017-05-19 19:46:15 -07:00
Nick Terrell
a1280406b0
[libzstd] Allow users to define custom visibility
2017-05-19 18:01:59 -07:00
Yann Collet
334a288d0d
ZSTD_CCtx_setParameter() only works during initialization stage
...
and generate a stage_wrong error otherwise.
2017-05-19 11:04:41 -07:00
Yann Collet
48855fa0d2
fixed declaration-after-statement warning
2017-05-19 10:56:11 -07:00
Yann Collet
fa3671eac7
changed ZSTD_BLOCKSIZE_ABSOLUTEMAX into ZSTD_BLOCKSIZE_MAX
...
Also :
change ZSTD_getBlockSizeMax() into ZSTD_getBlockSize()
created ZSTD_BLOCKSIZELOG_MAX
2017-05-19 10:51:30 -07:00
Yann Collet
009d604e00
ZSTD_compress_generic() supports multiple successive frames
...
also : clarified streaming API implementation
2017-05-19 10:17:59 -07:00
Yann Collet
6d4fef36de
Added ZSTD_compress_generic()
...
Used in fileio.c (zstd cli).
Need to set macro ZSTD_NEWAPI to trigger it.
2017-05-17 18:36:15 -07:00
Yann Collet
23c256e44b
removed useless variable from CCtx
...
CStream's pledgedSrcSize is no longer necessary
srcSize control is realized within bufferless interface.
2017-05-16 18:10:11 -07:00
Yann Collet
9f95e445ab
minor comment clarifications
2017-05-16 17:26:43 -07:00
Yann Collet
0bdb575c31
Merge branch 'dev' into advancedAPI2
2017-05-16 16:32:29 -07:00
Yann Collet
7101434ec9
pedantic : added one error check
...
on a function which (today) never fails.
But who knows, maybe tomorrow ...
2017-05-16 16:28:24 -07:00
Yann Collet
bfff8999c5
added prototype ZSTD_versionString()
2017-05-16 16:12:23 -07:00
Yann Collet
4eff8136aa
added prototype ZSTD_decompressBegin_usingDDict ( #700 )
2017-05-16 16:05:27 -07:00
Yann Collet
2d4d31c18a
removed gcc compilation flag -Wbad-function-cast
...
It makes it more difficult to directly cast the result of a function,
requiring to store the result in an intermediate variable.
It does not necessarily help readability,
and this restriction can be difficult to overcome in some constructions,
like some macros.
also : fixed minor Visual conversion warnings in datagencli.c
2017-05-16 11:34:38 -07:00
Yann Collet
133f0aee54
fixed redundant declarations in legacy v0.5 and v0.7 decoders
...
triggered by new flag -Wredundant-decls
2017-05-15 17:44:04 -07:00
Yann Collet
83d0c764dc
added several compilation flags
2017-05-15 17:15:46 -07:00
Yann Collet
a5ffe3d370
pushed enum values for strategy by one (ZSTD_fast==1)
...
this makes it possible to use `0` to mean:
"do not change strategy"
2017-05-12 16:29:19 -07:00
Yann Collet
add66f816d
changed macro LOADCPARAMS by static function ZSTD_cLevelToCParams()
...
for improved compiler checks.
Also : ensure most parameters can receive value "0"
to mean "do not change".
2017-05-12 16:01:15 -07:00
Yann Collet
b0edb7fb0e
added ZSTD_CCtx_setParameter()
2017-05-12 15:31:53 -07:00
Yann Collet
ef738c1b23
better error code when compressing using NULL CDict
...
which is not allowed (but detected, and generates an error).
2017-05-12 13:55:25 -07:00
Yann Collet
db8e21d5a0
made ZSTD_compress_generic() definition accessible
...
note that the implementation is not done yet.
2017-05-12 13:46:49 -07:00
Yann Collet
33eb7ac6b6
updated Advanced API proposal
...
only declarations in zstd.h
2017-05-12 12:36:11 -07:00
Yann Collet
bd1964a988
Merge pull request #696 from joscollin/wip-lib-legacy-fallthrough-warn
...
lib/legacy: warning: this statement may fall through
2017-05-11 10:45:01 -07:00
Yann Collet
4c1cfc0bb6
Merge pull request #695 from joscollin/wip-lib-compress-fallthrough-warn
...
lib/compress: warning: this statement may fall through
2017-05-11 10:44:27 -07:00
Jos Collin
280510f2d5
lib/legacy: warning: this statement may fall through
...
The following warning appears during build at sevaral places.
../lib/legacy/zstd_v04.c:819:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 7: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[6]) << (sizeof(size_t)*8 - 16);
../lib/legacy/zstd_v05.c:821:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 7: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[6]) << (sizeof(size_t)*8 - 16);
../lib/legacy/zstd_v06.c:913:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
../lib/legacy/zstd_v07.c:583:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) <<
(sizeof(bitD->bitContainer)*8 - 16);
Signed-off-by: Jos Collin <jcollin@redhat.com>
2017-05-11 14:27:40 +05:30