Skip to content

Commit

Permalink
Remove const data members in threadpooltest payload (facebook#2639)
Browse files Browse the repository at this point in the history
  • Loading branch information
senhuang42 committed May 12, 2021
1 parent 01fe479 commit 4d4b75b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ v1.5.0 (May 11, 2021)
api: Various functions and parameters promoted from experimental to stable API: (#2579-2581, @senhuang42)
`ZSTD_defaultCLevel()`
`ZSTD_getDictID_fromCDict()`
`ZSTD_c_literalCompressionMode`
api: Several experimental functions have been deprecated and will emit a compiler warning (#2582, @senhuang42)
`ZSTD_compress_advanced()`
`ZSTD_compress_usingCDict_advanced()`
Expand Down
26 changes: 11 additions & 15 deletions doc/zstd_manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,6 @@ <h3>Decompression context</h3><pre> When decompressing many times,
Only the order (from fast to strong) is guaranteed */
} ZSTD_strategy;
</b></pre><BR>
<pre><b>typedef enum {
ZSTD_lcm_auto = 0, </b>/**< Automatically determine the compression mode based on the compression level.<b>
* Negative compression levels will be uncompressed, and positive compression
* levels will be compressed. */
ZSTD_lcm_huffman = 1, </b>/**< Always attempt Huffman compression. Uncompressed literals will still be<b>
* emitted if Huffman compression is not profitable. */
ZSTD_lcm_uncompressed = 2 </b>/**< Always emit uncompressed literals. */<b>
} ZSTD_literalCompressionMode_e; </b>/* Requires v1.5.0+ */<b>
</b></pre><BR>
<pre><b>typedef enum {

</b>/* compression parameters<b>
Expand Down Expand Up @@ -280,12 +271,6 @@ <h3>Decompression context</h3><pre> When decompressing many times,
* The higher the value of selected strategy, the more complex it is,
* resulting in stronger and slower compression.
* Special: value 0 means "use default strategy". */
ZSTD_c_literalCompressionMode=108, </b>/* Note : requires v1.5.0+<b>
* Controls how the literals are compressed (default is auto).
* The value must be of type ZSTD_literalCompressionMode_e.
* See ZSTD_literalCompressionMode_e enum definition for details.
*/

</b>/* LDM mode parameters */<b>
ZSTD_c_enableLongDistanceMatching=160, </b>/* Enable long distance matching.<b>
* This parameter is designed to improve compression ratio
Expand Down Expand Up @@ -364,6 +349,7 @@ <h3>Decompression context</h3><pre> When decompressing many times,
* ZSTD_c_format
* ZSTD_c_forceMaxWindow
* ZSTD_c_forceAttachDict
* ZSTD_c_literalCompressionMode
* ZSTD_c_targetCBlockSize
* ZSTD_c_srcSizeHint
* ZSTD_c_enableDedicatedDictSearch
Expand All @@ -381,6 +367,7 @@ <h3>Decompression context</h3><pre> When decompressing many times,
ZSTD_c_experimentalParam2=10,
ZSTD_c_experimentalParam3=1000,
ZSTD_c_experimentalParam4=1001,
ZSTD_c_experimentalParam5=1002,
ZSTD_c_experimentalParam6=1003,
ZSTD_c_experimentalParam7=1004,
ZSTD_c_experimentalParam8=1005,
Expand Down Expand Up @@ -1075,6 +1062,15 @@ <h3>Streaming decompression functions</h3><pre></pre><b><pre></pre></b><BR>
ZSTD_dictForceLoad = 3 </b>/* Always reload the dictionary */<b>
} ZSTD_dictAttachPref_e;
</b></pre><BR>
<pre><b>typedef enum {
ZSTD_lcm_auto = 0, </b>/**< Automatically determine the compression mode based on the compression level.<b>
* Negative compression levels will be uncompressed, and positive compression
* levels will be compressed. */
ZSTD_lcm_huffman = 1, </b>/**< Always attempt Huffman compression. Uncompressed literals will still be<b>
* emitted if Huffman compression is not profitable. */
ZSTD_lcm_uncompressed = 2 </b>/**< Always emit uncompressed literals. */<b>
} ZSTD_literalCompressionMode_e;
</b></pre><BR>
<pre><b>typedef enum {
ZSTD_urm_auto = 0, </b>/* Automatically determine whether or not we use row matchfinder */<b>
ZSTD_urm_disableRowMatchFinder = 1, </b>/* Never use row matchfinder */<b>
Expand Down
32 changes: 17 additions & 15 deletions lib/zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,6 @@ typedef enum { ZSTD_fast=1,
Only the order (from fast to strong) is guaranteed */
} ZSTD_strategy;

typedef enum {
ZSTD_lcm_auto = 0, /**< Automatically determine the compression mode based on the compression level.
* Negative compression levels will be uncompressed, and positive compression
* levels will be compressed. */
ZSTD_lcm_huffman = 1, /**< Always attempt Huffman compression. Uncompressed literals will still be
* emitted if Huffman compression is not profitable. */
ZSTD_lcm_uncompressed = 2 /**< Always emit uncompressed literals. */
} ZSTD_literalCompressionMode_e; /* Requires v1.5.0+ */

typedef enum {

/* compression parameters
Expand Down Expand Up @@ -340,12 +331,6 @@ typedef enum {
* The higher the value of selected strategy, the more complex it is,
* resulting in stronger and slower compression.
* Special: value 0 means "use default strategy". */
ZSTD_c_literalCompressionMode=108, /* Note : requires v1.5.0+
* Controls how the literals are compressed (default is auto).
* The value must be of type ZSTD_literalCompressionMode_e.
* See ZSTD_literalCompressionMode_e enum definition for details.
*/

/* LDM mode parameters */
ZSTD_c_enableLongDistanceMatching=160, /* Enable long distance matching.
* This parameter is designed to improve compression ratio
Expand Down Expand Up @@ -424,6 +409,7 @@ typedef enum {
* ZSTD_c_format
* ZSTD_c_forceMaxWindow
* ZSTD_c_forceAttachDict
* ZSTD_c_literalCompressionMode
* ZSTD_c_targetCBlockSize
* ZSTD_c_srcSizeHint
* ZSTD_c_enableDedicatedDictSearch
Expand All @@ -441,6 +427,7 @@ typedef enum {
ZSTD_c_experimentalParam2=10,
ZSTD_c_experimentalParam3=1000,
ZSTD_c_experimentalParam4=1001,
ZSTD_c_experimentalParam5=1002,
ZSTD_c_experimentalParam6=1003,
ZSTD_c_experimentalParam7=1004,
ZSTD_c_experimentalParam8=1005,
Expand Down Expand Up @@ -1305,6 +1292,15 @@ typedef enum {
ZSTD_dictForceLoad = 3 /* Always reload the dictionary */
} ZSTD_dictAttachPref_e;

typedef enum {
ZSTD_lcm_auto = 0, /**< Automatically determine the compression mode based on the compression level.
* Negative compression levels will be uncompressed, and positive compression
* levels will be compressed. */
ZSTD_lcm_huffman = 1, /**< Always attempt Huffman compression. Uncompressed literals will still be
* emitted if Huffman compression is not profitable. */
ZSTD_lcm_uncompressed = 2 /**< Always emit uncompressed literals. */
} ZSTD_literalCompressionMode_e;

typedef enum {
ZSTD_urm_auto = 0, /* Automatically determine whether or not we use row matchfinder */
ZSTD_urm_disableRowMatchFinder = 1, /* Never use row matchfinder */
Expand Down Expand Up @@ -1716,6 +1712,12 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre
* See the comments on that enum for an explanation of the feature. */
#define ZSTD_c_forceAttachDict ZSTD_c_experimentalParam4

/* Controls how the literals are compressed (default is auto).
* The value must be of type ZSTD_literalCompressionMode_e.
* See ZSTD_literalCompressionMode_e enum definition for details.
*/
#define ZSTD_c_literalCompressionMode ZSTD_c_experimentalParam5

/* Tries to fit compressed block size to be around targetCBlockSize.
* No target when targetCBlockSize == 0.
* There is no guarantee on compressed block size (default:0) */
Expand Down
6 changes: 3 additions & 3 deletions tests/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ static void FUZ_decodeSequences(BYTE* dst, ZSTD_Sequence* seqs, size_t seqsSize,
typedef struct {
ZSTD_CCtx* cctx;
ZSTD_threadPool* pool;
void* const CNBuffer;
void* CNBuffer;
size_t CNBuffSize;
void* const compressedBuffer;
void* compressedBuffer;
size_t compressedBufferSize;
void* const decodedBuffer;
void* decodedBuffer;
int err;
} threadPoolTests_compressionJob_payload;

Expand Down

0 comments on commit 4d4b75b

Please sign in to comment.