mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
update minimum threshold for max block size
This commit is contained in:
@ -361,7 +361,6 @@ size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel)
|
|||||||
ZSTD_memset(cctxParams, 0, sizeof(*cctxParams));
|
ZSTD_memset(cctxParams, 0, sizeof(*cctxParams));
|
||||||
cctxParams->compressionLevel = compressionLevel;
|
cctxParams->compressionLevel = compressionLevel;
|
||||||
cctxParams->fParams.contentSizeFlag = 1;
|
cctxParams->fParams.contentSizeFlag = 1;
|
||||||
// cctxParams->maxBlockSize = ZSTD_BLOCKSIZE_MAX;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,7 +616,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
|
|||||||
return bounds;
|
return bounds;
|
||||||
|
|
||||||
case ZSTD_c_maxBlockSize:
|
case ZSTD_c_maxBlockSize:
|
||||||
bounds.lowerBound = 1;
|
bounds.lowerBound = ZSTD_BLOCKSIZE_MAX_MIN;
|
||||||
bounds.upperBound = ZSTD_BLOCKSIZE_MAX;
|
bounds.upperBound = ZSTD_BLOCKSIZE_MAX;
|
||||||
return bounds;
|
return bounds;
|
||||||
|
|
||||||
|
@ -141,6 +141,7 @@ ZSTDLIB_API const char* ZSTD_versionString(void);
|
|||||||
|
|
||||||
#define ZSTD_BLOCKSIZELOG_MAX 17
|
#define ZSTD_BLOCKSIZELOG_MAX 17
|
||||||
#define ZSTD_BLOCKSIZE_MAX (1<<ZSTD_BLOCKSIZELOG_MAX)
|
#define ZSTD_BLOCKSIZE_MAX (1<<ZSTD_BLOCKSIZELOG_MAX)
|
||||||
|
#define ZSTD_BLOCKSIZE_MAX_MIN 1 << 10 /* The minimum valid max blocksize. Maximum blocksizes smaller than this make compressBound() inaccurate. */
|
||||||
|
|
||||||
|
|
||||||
/***************************************
|
/***************************************
|
||||||
|
@ -104,7 +104,7 @@ void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, FUZZ_dataProducer
|
|||||||
setRand(cctx, ZSTD_c_useBlockSplitter, 0, 2, producer);
|
setRand(cctx, ZSTD_c_useBlockSplitter, 0, 2, producer);
|
||||||
setRand(cctx, ZSTD_c_deterministicRefPrefix, 0, 1, producer);
|
setRand(cctx, ZSTD_c_deterministicRefPrefix, 0, 1, producer);
|
||||||
setRand(cctx, ZSTD_c_prefetchCDictTables, 0, 2, producer);
|
setRand(cctx, ZSTD_c_prefetchCDictTables, 0, 2, producer);
|
||||||
setRand(cctx, ZSTD_c_maxBlockSize, 1 << 12, ZSTD_BLOCKSIZE_MAX, producer);
|
setRand(cctx, ZSTD_c_maxBlockSize, ZSTD_BLOCKSIZE_MAX_MIN, ZSTD_BLOCKSIZE_MAX, producer);
|
||||||
if (FUZZ_dataProducer_uint32Range(producer, 0, 1) == 0) {
|
if (FUZZ_dataProducer_uint32Range(producer, 0, 1) == 0) {
|
||||||
setRand(cctx, ZSTD_c_srcSizeHint, ZSTD_SRCSIZEHINT_MIN, 2 * srcSize, producer);
|
setRand(cctx, ZSTD_c_srcSizeHint, ZSTD_SRCSIZEHINT_MIN, 2 * srcSize, producer);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user