1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-04 22:58:46 +02:00

Re-Implement Workspace Shrinking when Oversized

This commit is contained in:
W. Felix Handte
2019-08-22 16:09:00 -04:00
parent e8cc137477
commit 901bba4ca6
3 changed files with 43 additions and 34 deletions

View File

@ -1451,7 +1451,8 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
zc->seqStore.maxNbSeq, zc->seqStore.maxNbLit,
zbuff, pledgedSrcSize) ) {
DEBUGLOG(4, "ZSTD_equivalentParams()==1 -> consider continue mode");
if (ZSTD_cwksp_bump_oversized_duration(&zc->workspace) <= ZSTD_WORKSPACETOOLARGE_MAXDURATION) {
ZSTD_cwksp_bump_oversized_duration(&zc->workspace, 0);
if (!ZSTD_cwksp_check_wasteful(&zc->workspace, 0)) {
DEBUGLOG(4, "continue mode confirmed (wLog1=%u, blockSize1=%zu)",
zc->appliedParams.cParams.windowLog, zc->blockSize);
if (ZSTD_indexTooCloseToMax(zc->blockState.matchState.window)) {