1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

changing to cParams.hashLog

This commit is contained in:
Bimba Shrestha
2020-04-21 21:12:50 -05:00
parent 0b107188b8
commit 659ff85cf5

View File

@ -767,7 +767,7 @@ static unsigned FIO_highbit64(unsigned long long v)
} }
static void FIO_adjustMemLimitForPatchFromMode(FIO_prefs_t* const prefs, static void FIO_adjustMemLimitForPatchFromMode(FIO_prefs_t* const prefs,
unsigned long long const dictSize, unsigned long long const dictSize,
unsigned long long const maxSrcFileSize) unsigned long long const maxSrcFileSize)
{ {
unsigned long long maxSize = MAX(prefs->memLimit, MAX(dictSize, maxSrcFileSize)); unsigned long long maxSize = MAX(prefs->memLimit, MAX(dictSize, maxSrcFileSize));
@ -795,9 +795,9 @@ typedef struct {
ZSTD_CStream* cctx; ZSTD_CStream* cctx;
} cRess_t; } cRess_t;
static void FIO_adjustParamsForPatchFromMode(FIO_prefs_t* const prefs, static void FIO_adjustParamsForPatchFromMode(FIO_prefs_t* const prefs,
ZSTD_compressionParameters* comprParams, ZSTD_compressionParameters* comprParams,
unsigned long long const dictSize, unsigned long long const dictSize,
unsigned long long const maxSrcFileSize, unsigned long long const maxSrcFileSize,
int cLevel) int cLevel)
{ {
@ -807,7 +807,7 @@ static void FIO_adjustParamsForPatchFromMode(FIO_prefs_t* const prefs,
if (fileWindowLog > ZSTD_WINDOWLOG_MAX) if (fileWindowLog > ZSTD_WINDOWLOG_MAX)
DISPLAYLEVEL(1, "Max window log exceeded by file (compression ratio will suffer)\n"); DISPLAYLEVEL(1, "Max window log exceeded by file (compression ratio will suffer)\n");
comprParams->windowLog = MIN(ZSTD_WINDOWLOG_MAX, fileWindowLog); comprParams->windowLog = MIN(ZSTD_WINDOWLOG_MAX, fileWindowLog);
if (fileWindowLog > ZSTD_cycleLog(comprParams->hashLog, cParams.strategy)) { if (fileWindowLog > ZSTD_cycleLog(cParams.hashLog, cParams.strategy)) {
if (!prefs->ldmFlag) if (!prefs->ldmFlag)
DISPLAYLEVEL(1, "long mode automaticaly triggered\n"); DISPLAYLEVEL(1, "long mode automaticaly triggered\n");
FIO_setLdmFlag(prefs, 1); FIO_setLdmFlag(prefs, 1);
@ -898,7 +898,7 @@ static cRess_t FIO_createCResources(FIO_prefs_t* const prefs,
} else { } else {
CHECK( ZSTD_CCtx_loadDictionary(ress.cctx, ress.dictBuffer, ress.dictBufferSize) ); CHECK( ZSTD_CCtx_loadDictionary(ress.cctx, ress.dictBuffer, ress.dictBufferSize) );
} }
return ress; return ress;
} }
@ -1724,7 +1724,7 @@ static dRess_t FIO_createDResources(FIO_prefs_t* const prefs, const char* dictFi
if (prefs->patchFromMode) if (prefs->patchFromMode)
FIO_adjustMemLimitForPatchFromMode(prefs, UTIL_getFileSize(dictFileName), 0 /* just use the dict size */); FIO_adjustMemLimitForPatchFromMode(prefs, UTIL_getFileSize(dictFileName), 0 /* just use the dict size */);
/* Allocation */ /* Allocation */
ress.dctx = ZSTD_createDStream(); ress.dctx = ZSTD_createDStream();
if (ress.dctx==NULL) if (ress.dctx==NULL)