Skip to content

Commit 5490c75

Browse files
committed
Also Allow/Document/Test Excluding dfast and Up
1 parent cc1ffe0 commit 5490c75

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.github/workflows/dev-short-tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ jobs:
349349
make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
350350
make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
351351
make clean && make check ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP=1 MOREFLAGS="-Werror"
352+
make clean && make check ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP=1 MOREFLAGS="-Werror"
352353
353354
dynamic-bmi2:
354355
runs-on: ubuntu-latest

lib/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ The file structure is designed to make this selection manually achievable for an
123123
strategies. In environments where the higher compression levels aren't used,
124124
it is possible to exclude all but the fastest strategy with
125125
`ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP=1`. (Note that this will change
126-
the behavior of the default compression level.)
126+
the behavior of the default compression level.) Or if you want to retain the
127+
default compressor as well, you can set
128+
`ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP=1`, at the cost of an additional
129+
~20KB or so.
127130

128131
For squeezing the last ounce of size out, you can also define
129132
`ZSTD_NO_INLINE`, which disables inlining, and `ZSTD_STRIP_ERROR_STRINGS`,

lib/libzstd.mk

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ endif
4848
ZSTD_NO_ASM ?= 0
4949

5050
ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP ?= 0
51+
ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP ?= 0
5152

5253
##################################################################
5354
# libzstd helpers
@@ -182,6 +183,10 @@ endif
182183

183184
ifneq ($(ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP), 0)
184185
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
186+
else
187+
ifneq ($(ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP), 0)
188+
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
189+
endif
185190
endif
186191

187192
ifneq ($(ZSTD_LEGACY_SUPPORT), 0)

0 commit comments

Comments
 (0)