mirror of
https://github.com/facebook/zstd.git
synced 2025-12-05 00:03:19 -05:00
fix window update (#3556)
This commit is contained in:
parent
a3c3a38b9b
commit
3e0550ee52
@ -4722,6 +4722,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
|
|||||||
assert(ZSTD_window_isEmpty(ms->window));
|
assert(ZSTD_window_isEmpty(ms->window));
|
||||||
if (loadLdmDict) assert(ZSTD_window_isEmpty(ls->window));
|
if (loadLdmDict) assert(ZSTD_window_isEmpty(ls->window));
|
||||||
}
|
}
|
||||||
|
ZSTD_window_update(&ms->window, src, srcSize, /* forceNonContiguous */ 0);
|
||||||
|
|
||||||
DEBUGLOG(4, "ZSTD_loadDictionaryContent(): useRowMatchFinder=%d", (int)params->useRowMatchFinder);
|
DEBUGLOG(4, "ZSTD_loadDictionaryContent(): useRowMatchFinder=%d", (int)params->useRowMatchFinder);
|
||||||
|
|
||||||
@ -4733,7 +4734,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
|
|||||||
|
|
||||||
/* If the dict is larger than we can reasonably index in our tables, only load the suffix. */
|
/* If the dict is larger than we can reasonably index in our tables, only load the suffix. */
|
||||||
if (params->cParams.strategy < ZSTD_btultra) {
|
if (params->cParams.strategy < ZSTD_btultra) {
|
||||||
U32 maxDictSize = 8U << MIN(MAX(params->cParams.hashLog, params->cParams.chainLog), 27);
|
U32 maxDictSize = 8U << MIN(MAX(params->cParams.hashLog, params->cParams.chainLog), 28);
|
||||||
if (srcSize > maxDictSize) {
|
if (srcSize > maxDictSize) {
|
||||||
ip = iend - maxDictSize;
|
ip = iend - maxDictSize;
|
||||||
src = ip;
|
src = ip;
|
||||||
@ -4741,7 +4742,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSTD_window_update(&ms->window, src, srcSize, /* forceNonContiguous */ 0);
|
ms->nextToUpdate = (U32)(ip - ms->window.base);
|
||||||
ms->loadedDictEnd = params->forceWindow ? 0 : (U32)(iend - ms->window.base);
|
ms->loadedDictEnd = params->forceWindow ? 0 : (U32)(iend - ms->window.base);
|
||||||
ms->forceNonContiguous = params->deterministicRefPrefix;
|
ms->forceNonContiguous = params->deterministicRefPrefix;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user