]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Also Allow/Document/Test Excluding dfast and Up
authorW. Felix Handte <w@felixhandte.com>
Thu, 4 May 2023 16:31:41 +0000 (12:31 -0400)
committerW. Felix Handte <w@felixhandte.com>
Thu, 4 May 2023 16:31:41 +0000 (12:31 -0400)
.github/workflows/dev-short-tests.yml
lib/README.md
lib/libzstd.mk

index 566c84d0171c27b7d25277b5c6bf2fbb2a4565d5..9474190ffdee45ade517c92a45b2eef129180ebd 100644 (file)
@@ -349,6 +349,7 @@ jobs:
         make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
         make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
         make clean && make check ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP=1 MOREFLAGS="-Werror"
+        make clean && make check ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP=1 MOREFLAGS="-Werror"
 
   dynamic-bmi2:
     runs-on: ubuntu-latest
index 2da16647a7fb2f2c3a51d2839f93f96e5b42c0d8..47982093382f24bcde5946c62f856c114a1fbe94 100644 (file)
@@ -123,7 +123,10 @@ The file structure is designed to make this selection manually achievable for an
   strategies. In environments where the higher compression levels aren't used,
   it is possible to exclude all but the fastest strategy with
   `ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP=1`. (Note that this will change
-  the behavior of the default compression level.)
+  the behavior of the default compression level.) Or if you want to retain the
+  default compressor as well, you can set
+  `ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP=1`, at the cost of an additional
+  ~20KB or so.
 
   For squeezing the last ounce of size out, you can also define
   `ZSTD_NO_INLINE`, which disables inlining, and `ZSTD_STRIP_ERROR_STRINGS`,
index 0b1e03907c1be136f377b6af2497ec96beb0e46b..2c47ecdfa060bf8eb184cd36995cbbf330677b1e 100644 (file)
@@ -48,6 +48,7 @@ endif
 ZSTD_NO_ASM ?= 0
 
 ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP ?= 0
+ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP ?= 0
 
 ##################################################################
 # libzstd helpers
@@ -182,6 +183,10 @@ endif
 
 ifneq ($(ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP), 0)
   CFLAGS += -DZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR
+else
+ifneq ($(ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP), 0)
+  CFLAGS += -DZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR
+endif
 endif
 
 ifneq ($(ZSTD_LEGACY_SUPPORT), 0)