Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion programs/zstdcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,9 +1102,9 @@ int main(int argCount, const char* argv[])
}
#endif
if (longCommandWArg(&argument, "--threads")) { NEXT_UINT32(nbWorkers); setThreads_non1 = (nbWorkers != 1); continue; }
if (longCommandWArg(&argument, "--memlimit-decompress")) { NEXT_UINT32(memLimit); continue; }
if (longCommandWArg(&argument, "--memlimit")) { NEXT_UINT32(memLimit); continue; }
if (longCommandWArg(&argument, "--memory")) { NEXT_UINT32(memLimit); continue; }
if (longCommandWArg(&argument, "--memlimit-decompress")) { NEXT_UINT32(memLimit); continue; }
if (longCommandWArg(&argument, "--block-size")) { NEXT_TSIZE(chunkSize); continue; } /* hidden command, prefer --split below */
if (longCommandWArg(&argument, "--split")) { NEXT_TSIZE(chunkSize); continue; }
if (longCommandWArg(&argument, "--jobsize")) { NEXT_TSIZE(chunkSize); continue; } /* note: overloaded variable */
Expand Down
15 changes: 15 additions & 0 deletions tests/cli-tests/basic/memlimit_alias.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -eu

datagen -g500K > input
zstd -q input
for option in --memlimit --memory --memlimit-decompress; do
zstd -dc "$option=8M" input.zst > output
cmp input output
zstd -dc "$option" 8M input.zst > output
cmp input output
if zstd -qdc "$option=1K" input.zst > output 2> error; then
die "Decompression exceeded the memory limit"
fi
grep -q 'Window size larger than maximum' error
done
Empty file.
Empty file.