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

disable --max in 32-bit mode

This commit is contained in:
Yann Collet
2025-02-09 23:14:16 -08:00
parent 1603cbe83e
commit 468e1453a5
2 changed files with 22 additions and 13 deletions

View File

@@ -163,8 +163,8 @@ the last one takes effect.
`--memory=windowSize` needs to be passed to the decompressor. `--memory=windowSize` needs to be passed to the decompressor.
* `--max`: * `--max`:
set advanced parameters to maximum compression. set advanced parameters to maximum compression.
warning: this setting uses a lot of resources and is very slow. warning: this setting is very slow and uses a lot of resources.
note that the amount of resource required is typically too large for 32-bit. It's inappropriate for 32-bit mode and therefore disabled in this mode.
* `-D DICT`: * `-D DICT`:
use `DICT` as Dictionary to compress or decompress FILE(s) use `DICT` as Dictionary to compress or decompress FILE(s)
* `--patch-from FILE`: * `--patch-from FILE`:

View File

@@ -973,7 +973,6 @@ int main(int argCount, const char* argv[])
if (!strcmp(argument, "--quiet")) { g_displayLevel--; continue; } if (!strcmp(argument, "--quiet")) { g_displayLevel--; continue; }
if (!strcmp(argument, "--stdout")) { forceStdout=1; outFileName=stdoutmark; continue; } if (!strcmp(argument, "--stdout")) { forceStdout=1; outFileName=stdoutmark; continue; }
if (!strcmp(argument, "--ultra")) { ultra=1; continue; } if (!strcmp(argument, "--ultra")) { ultra=1; continue; }
if (!strcmp(argument, "--max")) { ultra=1; ldmFlag = 1; setMaxCompression(&compressionParams); continue; }
if (!strcmp(argument, "--check")) { FIO_setChecksumFlag(prefs, 2); continue; } if (!strcmp(argument, "--check")) { FIO_setChecksumFlag(prefs, 2); continue; }
if (!strcmp(argument, "--no-check")) { FIO_setChecksumFlag(prefs, 0); continue; } if (!strcmp(argument, "--no-check")) { FIO_setChecksumFlag(prefs, 0); continue; }
if (!strcmp(argument, "--sparse")) { FIO_setSparseWrite(prefs, 2); continue; } if (!strcmp(argument, "--sparse")) { FIO_setSparseWrite(prefs, 2); continue; }
@@ -1024,6 +1023,16 @@ int main(int argCount, const char* argv[])
if (!strcmp(argument, "--fake-stderr-is-console")) { UTIL_fakeStderrIsConsole(); continue; } if (!strcmp(argument, "--fake-stderr-is-console")) { UTIL_fakeStderrIsConsole(); continue; }
if (!strcmp(argument, "--trace-file-stat")) { UTIL_traceFileStat(); continue; } if (!strcmp(argument, "--trace-file-stat")) { UTIL_traceFileStat(); continue; }
if (!strcmp(argument, "--max")) {
if (sizeof(void*)==4) {
DISPLAYLEVEL(2, "--max is incompatible with 32-bit mode \n");
badUsage(programName, originalArgument);
CLEAN_RETURN(1);
}
ultra=1; ldmFlag = 1; setMaxCompression(&compressionParams);
continue;
}
/* long commands with arguments */ /* long commands with arguments */
#ifndef ZSTD_NODICT #ifndef ZSTD_NODICT
if (longCommandWArg(&argument, "--train-cover")) { if (longCommandWArg(&argument, "--train-cover")) {