mirror of
https://github.com/facebook/zstd.git
synced 2025-10-11 00:03:06 -04:00
Apply DDS adjustments to avoid assert failures
This commit is contained in:
parent
f80dec66b0
commit
efa6dfa729
@ -6192,7 +6192,7 @@ static int ZSTD_dedicatedDictSearch_isSupported(
|
|||||||
{
|
{
|
||||||
return (cParams->strategy >= ZSTD_greedy)
|
return (cParams->strategy >= ZSTD_greedy)
|
||||||
&& (cParams->strategy <= ZSTD_lazy2)
|
&& (cParams->strategy <= ZSTD_lazy2)
|
||||||
&& (cParams->hashLog >= cParams->chainLog)
|
&& (cParams->hashLog > cParams->chainLog)
|
||||||
&& (cParams->chainLog <= 24);
|
&& (cParams->chainLog <= 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6211,6 +6211,9 @@ static void ZSTD_dedicatedDictSearch_revertCParams(
|
|||||||
case ZSTD_lazy:
|
case ZSTD_lazy:
|
||||||
case ZSTD_lazy2:
|
case ZSTD_lazy2:
|
||||||
cParams->hashLog -= ZSTD_LAZY_DDSS_BUCKET_LOG;
|
cParams->hashLog -= ZSTD_LAZY_DDSS_BUCKET_LOG;
|
||||||
|
if (cParams->hashLog < ZSTD_HASHLOG_MIN) {
|
||||||
|
cParams->hashLog = ZSTD_HASHLOG_MIN;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ZSTD_btlazy2:
|
case ZSTD_btlazy2:
|
||||||
case ZSTD_btopt:
|
case ZSTD_btopt:
|
||||||
|
@ -469,7 +469,7 @@ void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const B
|
|||||||
U32 hashIdx;
|
U32 hashIdx;
|
||||||
|
|
||||||
assert(ms->cParams.chainLog <= 24);
|
assert(ms->cParams.chainLog <= 24);
|
||||||
assert(ms->cParams.hashLog >= ms->cParams.chainLog);
|
assert(ms->cParams.hashLog > ms->cParams.chainLog);
|
||||||
assert(idx != 0);
|
assert(idx != 0);
|
||||||
assert(tmpMinChain <= minChain);
|
assert(tmpMinChain <= minChain);
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const B
|
|||||||
if (count == cacheSize) {
|
if (count == cacheSize) {
|
||||||
for (count = 0; count < chainLimit;) {
|
for (count = 0; count < chainLimit;) {
|
||||||
if (i < minChain) {
|
if (i < minChain) {
|
||||||
if (!i || countBeyondMinChain++ > cacheSize) {
|
if (!i || ++countBeyondMinChain > cacheSize) {
|
||||||
/* only allow pulling `cacheSize` number of entries
|
/* only allow pulling `cacheSize` number of entries
|
||||||
* into the cache or chainTable beyond `minChain`,
|
* into the cache or chainTable beyond `minChain`,
|
||||||
* to replace the entries pulled out of the
|
* to replace the entries pulled out of the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user