Merge pull request #3042 from u1f35c/fix2968
Fix required decompression memory usage reported by -vv + --long
This commit is contained in:
+7
-2
@@ -1301,8 +1301,13 @@ FIO_compressZstdFrame(FIO_ctx_t* const fCtx,
|
|||||||
UTIL_HumanReadableSize_t windowSize;
|
UTIL_HumanReadableSize_t windowSize;
|
||||||
CHECK(ZSTD_CCtx_getParameter(ress.cctx, ZSTD_c_windowLog, &windowLog));
|
CHECK(ZSTD_CCtx_getParameter(ress.cctx, ZSTD_c_windowLog, &windowLog));
|
||||||
if (windowLog == 0) {
|
if (windowLog == 0) {
|
||||||
const ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, fileSize, 0);
|
if (prefs->ldmFlag) {
|
||||||
windowLog = cParams.windowLog;
|
/* If long mode is set without a window size libzstd will set this size internally */
|
||||||
|
windowLog = ZSTD_WINDOWLOG_LIMIT_DEFAULT;
|
||||||
|
} else {
|
||||||
|
const ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, fileSize, 0);
|
||||||
|
windowLog = cParams.windowLog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
windowSize = UTIL_makeHumanReadableSize(MAX(1ULL, MIN(1ULL << windowLog, pledgedSrcSize)));
|
windowSize = UTIL_makeHumanReadableSize(MAX(1ULL, MIN(1ULL << windowLog, pledgedSrcSize)));
|
||||||
DISPLAYLEVEL(4, "Decompression will require %.*f%s of memory\n", windowSize.precision, windowSize.value, windowSize.suffix);
|
DISPLAYLEVEL(4, "Decompression will require %.*f%s of memory\n", windowSize.precision, windowSize.value, windowSize.suffix);
|
||||||
|
|||||||
Reference in New Issue
Block a user