mirror of
https://github.com/facebook/zstd.git
synced 2025-08-05 19:15:58 +03:00
changed variable name to ZSTD_c_blockSplitterLevel
suggested by @terrelln
This commit is contained in:
@@ -603,7 +603,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
|
|||||||
bounds.upperBound = (int)ZSTD_ps_disable;
|
bounds.upperBound = (int)ZSTD_ps_disable;
|
||||||
return bounds;
|
return bounds;
|
||||||
|
|
||||||
case ZSTD_c_blockSplitter_level:
|
case ZSTD_c_blockSplitterLevel:
|
||||||
bounds.lowerBound = 0;
|
bounds.lowerBound = 0;
|
||||||
bounds.upperBound = ZSTD_BLOCKSPLITTER_LEVEL_MAX;
|
bounds.upperBound = ZSTD_BLOCKSPLITTER_LEVEL_MAX;
|
||||||
return bounds;
|
return bounds;
|
||||||
@@ -674,7 +674,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param)
|
|||||||
case ZSTD_c_minMatch:
|
case ZSTD_c_minMatch:
|
||||||
case ZSTD_c_targetLength:
|
case ZSTD_c_targetLength:
|
||||||
case ZSTD_c_strategy:
|
case ZSTD_c_strategy:
|
||||||
case ZSTD_c_blockSplitter_level:
|
case ZSTD_c_blockSplitterLevel:
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case ZSTD_c_format:
|
case ZSTD_c_format:
|
||||||
@@ -761,7 +761,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value)
|
|||||||
case ZSTD_c_blockDelimiters:
|
case ZSTD_c_blockDelimiters:
|
||||||
case ZSTD_c_validateSequences:
|
case ZSTD_c_validateSequences:
|
||||||
case ZSTD_c_useBlockSplitter:
|
case ZSTD_c_useBlockSplitter:
|
||||||
case ZSTD_c_blockSplitter_level:
|
case ZSTD_c_blockSplitterLevel:
|
||||||
case ZSTD_c_useRowMatchFinder:
|
case ZSTD_c_useRowMatchFinder:
|
||||||
case ZSTD_c_deterministicRefPrefix:
|
case ZSTD_c_deterministicRefPrefix:
|
||||||
case ZSTD_c_prefetchCDictTables:
|
case ZSTD_c_prefetchCDictTables:
|
||||||
@@ -987,8 +987,8 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams,
|
|||||||
CCtxParams->postBlockSplitter = (ZSTD_paramSwitch_e)value;
|
CCtxParams->postBlockSplitter = (ZSTD_paramSwitch_e)value;
|
||||||
return CCtxParams->postBlockSplitter;
|
return CCtxParams->postBlockSplitter;
|
||||||
|
|
||||||
case ZSTD_c_blockSplitter_level:
|
case ZSTD_c_blockSplitterLevel:
|
||||||
BOUNDCHECK(ZSTD_c_blockSplitter_level, value);
|
BOUNDCHECK(ZSTD_c_blockSplitterLevel, value);
|
||||||
CCtxParams->preBlockSplitter_level = value;
|
CCtxParams->preBlockSplitter_level = value;
|
||||||
return (size_t)CCtxParams->preBlockSplitter_level;
|
return (size_t)CCtxParams->preBlockSplitter_level;
|
||||||
|
|
||||||
@@ -1150,7 +1150,7 @@ size_t ZSTD_CCtxParams_getParameter(
|
|||||||
case ZSTD_c_useBlockSplitter :
|
case ZSTD_c_useBlockSplitter :
|
||||||
*value = (int)CCtxParams->postBlockSplitter;
|
*value = (int)CCtxParams->postBlockSplitter;
|
||||||
break;
|
break;
|
||||||
case ZSTD_c_blockSplitter_level :
|
case ZSTD_c_blockSplitterLevel :
|
||||||
*value = CCtxParams->preBlockSplitter_level;
|
*value = CCtxParams->preBlockSplitter_level;
|
||||||
break;
|
break;
|
||||||
case ZSTD_c_useRowMatchFinder :
|
case ZSTD_c_useRowMatchFinder :
|
||||||
|
@@ -496,7 +496,7 @@ typedef enum {
|
|||||||
* ZSTD_c_prefetchCDictTables
|
* ZSTD_c_prefetchCDictTables
|
||||||
* ZSTD_c_enableSeqProducerFallback
|
* ZSTD_c_enableSeqProducerFallback
|
||||||
* ZSTD_c_maxBlockSize
|
* ZSTD_c_maxBlockSize
|
||||||
* ZSTD_c_blockSplitter_level
|
* ZSTD_c_blockSplitterLevel
|
||||||
* Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
|
* Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
|
||||||
* note : never ever use experimentalParam? names directly;
|
* note : never ever use experimentalParam? names directly;
|
||||||
* also, the enums values themselves are unstable and can still change.
|
* also, the enums values themselves are unstable and can still change.
|
||||||
@@ -2265,7 +2265,7 @@ ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const vo
|
|||||||
*/
|
*/
|
||||||
#define ZSTD_c_searchForExternalRepcodes ZSTD_c_experimentalParam19
|
#define ZSTD_c_searchForExternalRepcodes ZSTD_c_experimentalParam19
|
||||||
|
|
||||||
/* ZSTD_c_blockSplitter_level
|
/* ZSTD_c_blockSplitterLevel
|
||||||
* note: this parameter only influences the first splitter stage,
|
* note: this parameter only influences the first splitter stage,
|
||||||
* which is active before producing the sequences.
|
* which is active before producing the sequences.
|
||||||
* ZSTD_c_useBlockSplitter influence the next splitter stage,
|
* ZSTD_c_useBlockSplitter influence the next splitter stage,
|
||||||
@@ -2281,7 +2281,7 @@ ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const vo
|
|||||||
* to ensure expansion guarantees in presence of incompressible data.
|
* to ensure expansion guarantees in presence of incompressible data.
|
||||||
*/
|
*/
|
||||||
#define ZSTD_BLOCKSPLITTER_LEVEL_MAX 6
|
#define ZSTD_BLOCKSPLITTER_LEVEL_MAX 6
|
||||||
#define ZSTD_c_blockSplitter_level ZSTD_c_experimentalParam20
|
#define ZSTD_c_blockSplitterLevel ZSTD_c_experimentalParam20
|
||||||
|
|
||||||
/*! ZSTD_CCtx_getParameter() :
|
/*! ZSTD_CCtx_getParameter() :
|
||||||
* Get the requested compression parameter value, selected by enum ZSTD_cParameter,
|
* Get the requested compression parameter value, selected by enum ZSTD_cParameter,
|
||||||
|
@@ -595,11 +595,11 @@ static void test_blockSplitter_incompressibleExpansionProtection(unsigned testNb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* run first without splitting */
|
/* run first without splitting */
|
||||||
ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitter_level, 1 /* no split */);
|
ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitterLevel, 1 /* no split */);
|
||||||
cSizeNoSplit = ZSTD_compress2(cctx, cBuffer, dstCapacity, incompressible, srcSize);
|
cSizeNoSplit = ZSTD_compress2(cctx, cBuffer, dstCapacity, incompressible, srcSize);
|
||||||
|
|
||||||
/* run with sample43 splitter, check it's still the same */
|
/* run with sample43 splitter, check it's still the same */
|
||||||
ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitter_level, 3 /* sample43, fastest _byChunk variant */);
|
ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitterLevel, 3 /* sample43, fastest _byChunk variant */);
|
||||||
cSizeWithSplit = ZSTD_compress2(cctx, cBuffer, dstCapacity, incompressible, srcSize);
|
cSizeWithSplit = ZSTD_compress2(cctx, cBuffer, dstCapacity, incompressible, srcSize);
|
||||||
|
|
||||||
if (cSizeWithSplit != cSizeNoSplit) {
|
if (cSizeWithSplit != cSizeNoSplit) {
|
||||||
|
Reference in New Issue
Block a user