extzstd 0.1.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. data/HISTORY.ja.md +18 -0
  3. data/README.md +15 -50
  4. data/contrib/zstd/CONTRIBUTING.md +1 -1
  5. data/contrib/zstd/COPYING +339 -0
  6. data/contrib/zstd/Makefile +82 -51
  7. data/contrib/zstd/NEWS +92 -5
  8. data/contrib/zstd/README.md +50 -41
  9. data/contrib/zstd/appveyor.yml +164 -102
  10. data/contrib/zstd/circle.yml +10 -22
  11. data/contrib/zstd/lib/BUCK +31 -10
  12. data/contrib/zstd/lib/Makefile +57 -31
  13. data/contrib/zstd/lib/README.md +68 -37
  14. data/contrib/zstd/lib/common/bitstream.h +130 -76
  15. data/contrib/zstd/lib/common/compiler.h +86 -0
  16. data/contrib/zstd/lib/common/error_private.c +15 -11
  17. data/contrib/zstd/lib/common/error_private.h +8 -8
  18. data/contrib/zstd/lib/common/fse.h +19 -9
  19. data/contrib/zstd/lib/common/fse_decompress.c +3 -22
  20. data/contrib/zstd/lib/common/huf.h +68 -26
  21. data/contrib/zstd/lib/common/mem.h +23 -35
  22. data/contrib/zstd/lib/common/pool.c +123 -63
  23. data/contrib/zstd/lib/common/pool.h +19 -10
  24. data/contrib/zstd/lib/common/threading.c +11 -16
  25. data/contrib/zstd/lib/common/threading.h +52 -33
  26. data/contrib/zstd/lib/common/xxhash.c +28 -22
  27. data/contrib/zstd/lib/common/zstd_common.c +40 -27
  28. data/contrib/zstd/lib/common/zstd_errors.h +43 -34
  29. data/contrib/zstd/lib/common/zstd_internal.h +131 -123
  30. data/contrib/zstd/lib/compress/fse_compress.c +17 -33
  31. data/contrib/zstd/lib/compress/huf_compress.c +15 -9
  32. data/contrib/zstd/lib/compress/zstd_compress.c +2096 -2363
  33. data/contrib/zstd/lib/compress/zstd_compress_internal.h +462 -0
  34. data/contrib/zstd/lib/compress/zstd_double_fast.c +309 -0
  35. data/contrib/zstd/lib/compress/zstd_double_fast.h +29 -0
  36. data/contrib/zstd/lib/compress/zstd_fast.c +243 -0
  37. data/contrib/zstd/lib/compress/zstd_fast.h +31 -0
  38. data/contrib/zstd/lib/compress/zstd_lazy.c +765 -0
  39. data/contrib/zstd/lib/compress/zstd_lazy.h +39 -0
  40. data/contrib/zstd/lib/compress/zstd_ldm.c +707 -0
  41. data/contrib/zstd/lib/compress/zstd_ldm.h +68 -0
  42. data/contrib/zstd/lib/compress/zstd_opt.c +785 -0
  43. data/contrib/zstd/lib/compress/zstd_opt.h +19 -908
  44. data/contrib/zstd/lib/compress/zstdmt_compress.c +737 -327
  45. data/contrib/zstd/lib/compress/zstdmt_compress.h +88 -26
  46. data/contrib/zstd/lib/decompress/huf_decompress.c +158 -50
  47. data/contrib/zstd/lib/decompress/zstd_decompress.c +884 -699
  48. data/contrib/zstd/lib/deprecated/zbuff.h +5 -4
  49. data/contrib/zstd/lib/deprecated/zbuff_common.c +5 -5
  50. data/contrib/zstd/lib/deprecated/zbuff_compress.c +6 -4
  51. data/contrib/zstd/lib/deprecated/zbuff_decompress.c +5 -4
  52. data/contrib/zstd/lib/dictBuilder/cover.c +93 -77
  53. data/contrib/zstd/lib/dictBuilder/zdict.c +107 -92
  54. data/contrib/zstd/lib/dictBuilder/zdict.h +112 -102
  55. data/contrib/zstd/lib/legacy/zstd_legacy.h +9 -4
  56. data/contrib/zstd/lib/legacy/zstd_v01.c +7 -6
  57. data/contrib/zstd/lib/legacy/zstd_v01.h +5 -4
  58. data/contrib/zstd/lib/legacy/zstd_v02.c +27 -99
  59. data/contrib/zstd/lib/legacy/zstd_v02.h +5 -4
  60. data/contrib/zstd/lib/legacy/zstd_v03.c +26 -98
  61. data/contrib/zstd/lib/legacy/zstd_v03.h +5 -4
  62. data/contrib/zstd/lib/legacy/zstd_v04.c +22 -91
  63. data/contrib/zstd/lib/legacy/zstd_v04.h +5 -4
  64. data/contrib/zstd/lib/legacy/zstd_v05.c +23 -99
  65. data/contrib/zstd/lib/legacy/zstd_v05.h +5 -4
  66. data/contrib/zstd/lib/legacy/zstd_v06.c +22 -96
  67. data/contrib/zstd/lib/legacy/zstd_v06.h +5 -4
  68. data/contrib/zstd/lib/legacy/zstd_v07.c +19 -95
  69. data/contrib/zstd/lib/legacy/zstd_v07.h +5 -4
  70. data/contrib/zstd/lib/zstd.h +895 -271
  71. data/ext/extconf.rb +11 -2
  72. data/ext/extzstd.c +45 -128
  73. data/ext/extzstd.h +74 -31
  74. data/ext/extzstd_stream.c +401 -142
  75. data/ext/zstd_common.c +5 -0
  76. data/ext/zstd_compress.c +8 -0
  77. data/ext/zstd_decompress.c +1 -0
  78. data/ext/zstd_dictbuilder.c +2 -0
  79. data/lib/extzstd/version.rb +1 -1
  80. data/lib/extzstd.rb +48 -1
  81. data/test/test_basic.rb +9 -1
  82. metadata +17 -7
  83. data/HISTORY.ja +0 -10
  84. data/contrib/zstd/LICENSE-examples +0 -11
  85. data/contrib/zstd/PATENTS +0 -33
@@ -1,10 +1,10 @@
1
1
  # ################################################################
2
- # Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
2
+ # Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
3
3
  # All rights reserved.
4
4
  #
5
- # This source code is licensed under the BSD-style license found in the
6
- # LICENSE file in the root directory of this source tree. An additional grant
7
- # of patent rights can be found in the PATENTS file in the same directory.
5
+ # This source code is licensed under both the BSD-style license (found in the
6
+ # LICENSE file in the root directory of this source tree) and the GPLv2 (found
7
+ # in the COPYING file in the root directory of this source tree).
8
8
  # ################################################################
9
9
 
10
10
  PRGDIR = programs
@@ -12,6 +12,7 @@ ZSTDDIR = lib
12
12
  BUILDIR = build
13
13
  ZWRAPDIR = zlibWrapper
14
14
  TESTDIR = tests
15
+ FUZZDIR = $(TESTDIR)/fuzz
15
16
 
16
17
  # Define nul output
17
18
  VOID = /dev/null
@@ -29,15 +30,12 @@ default: lib-release zstd-release
29
30
  all: | allmost examples manual
30
31
 
31
32
  .PHONY: allmost
32
- allmost:
33
- $(MAKE) -C $(ZSTDDIR) all
34
- $(MAKE) -C $(PRGDIR) all
35
- $(MAKE) -C $(TESTDIR) all
33
+ allmost: allzstd
36
34
  $(MAKE) -C $(ZWRAPDIR) all
37
35
 
38
36
  #skip zwrapper, can't build that on alternate architectures without the proper zlib installed
39
- .PHONY: allarch
40
- allarch:
37
+ .PHONY: allzstd
38
+ allzstd:
41
39
  $(MAKE) -C $(ZSTDDIR) all
42
40
  $(MAKE) -C $(PRGDIR) all
43
41
  $(MAKE) -C $(TESTDIR) all
@@ -74,12 +72,12 @@ zstdmt:
74
72
  zlibwrapper:
75
73
  $(MAKE) -C $(ZWRAPDIR) test
76
74
 
77
- .PHONY: shortest
78
- shortest:
79
- $(MAKE) -C $(TESTDIR) $@
75
+ .PHONY: check
76
+ check: shortest
80
77
 
81
- .PHONY: test
82
- test:
78
+ .PHONY: test shortest
79
+ test shortest:
80
+ $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS="-g -DZSTD_DEBUG=1"
83
81
  $(MAKE) -C $(TESTDIR) $@
84
82
 
85
83
  .PHONY: examples
@@ -90,6 +88,10 @@ examples:
90
88
  manual:
91
89
  $(MAKE) -C contrib/gen_html $@
92
90
 
91
+ .PHONY: cleanTabs
92
+ cleanTabs:
93
+ cd contrib; ./cleanTabs
94
+
93
95
  .PHONY: clean
94
96
  clean:
95
97
  @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID)
@@ -99,38 +101,51 @@ clean:
99
101
  @$(MAKE) -C examples/ $@ > $(VOID)
100
102
  @$(MAKE) -C contrib/gen_html $@ > $(VOID)
101
103
  @$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
104
+ @$(RM) -r lz4
102
105
  @echo Cleaning completed
103
106
 
104
107
  #------------------------------------------------------------------------------
105
108
  # make install is validated only for Linux, OSX, Hurd and some BSD targets
106
109
  #------------------------------------------------------------------------------
107
- ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD))
110
+ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT))
111
+
108
112
  HOST_OS = POSIX
109
- .PHONY: install uninstall travis-install clangtest gpptest armtest usan asan uasan
113
+ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON
110
114
 
115
+ .PHONY: list
116
+ list:
117
+ @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
118
+
119
+ .PHONY: install clangtest armtest usan asan uasan
111
120
  install:
112
121
  @$(MAKE) -C $(ZSTDDIR) $@
113
122
  @$(MAKE) -C $(PRGDIR) $@
114
123
 
124
+ .PHONY: uninstall
115
125
  uninstall:
116
126
  @$(MAKE) -C $(ZSTDDIR) $@
117
127
  @$(MAKE) -C $(PRGDIR) $@
118
128
 
129
+ .PHONY: travis-install
119
130
  travis-install:
120
131
  $(MAKE) install PREFIX=~/install_test_dir
121
132
 
122
- gppbuild: clean
123
- g++ -v
124
- CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
125
-
133
+ .PHONY: gcc5build
126
134
  gcc5build: clean
127
135
  gcc-5 -v
128
136
  CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror"
129
137
 
138
+ .PHONY: gcc6build
130
139
  gcc6build: clean
131
140
  gcc-6 -v
132
141
  CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror"
133
142
 
143
+ .PHONY: gcc7build
144
+ gcc7build: clean
145
+ gcc-7 -v
146
+ CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror"
147
+
148
+ .PHONY: clangbuild
134
149
  clangbuild: clean
135
150
  clang -v
136
151
  CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation"
@@ -140,31 +155,33 @@ m32build: clean
140
155
  $(MAKE) all32
141
156
 
142
157
  armbuild: clean
143
- CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch
158
+ CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd
144
159
 
145
160
  aarch64build: clean
146
- CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch
161
+ CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd
147
162
 
148
163
  ppcbuild: clean
149
- CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch
164
+ CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd
150
165
 
151
166
  ppc64build: clean
152
- CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch
167
+ CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd
153
168
 
154
169
  armfuzz: clean
155
- CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" $(MAKE) -C $(TESTDIR) fuzztest
170
+ CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
156
171
 
157
172
  aarch64fuzz: clean
158
- CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" $(MAKE) -C $(TESTDIR) fuzztest
173
+ CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
159
174
 
160
175
  ppcfuzz: clean
161
- CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" $(MAKE) -C $(TESTDIR) fuzztest
176
+ CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
162
177
 
163
178
  ppc64fuzz: clean
164
- CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" $(MAKE) -C $(TESTDIR) fuzztest
179
+ CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
165
180
 
166
- gpptest: clean
167
- CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
181
+ .PHONY: cxxtest
182
+ cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror
183
+ cxxtest: clean
184
+ $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly
168
185
 
169
186
  gcc5test: clean
170
187
  gcc-5 -v
@@ -180,19 +197,19 @@ clangtest: clean
180
197
 
181
198
  armtest: clean
182
199
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
183
- $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
200
+ $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
184
201
 
185
202
  aarch64test:
186
203
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
187
- $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
204
+ $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
188
205
 
189
206
  ppctest: clean
190
207
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
191
- $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static"
208
+ $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests
192
209
 
193
210
  ppc64test: clean
194
211
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
195
- $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static"
212
+ $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests
196
213
 
197
214
  arm-ppc-compilation:
198
215
  $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
@@ -200,6 +217,15 @@ arm-ppc-compilation:
200
217
  $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static"
201
218
  $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static"
202
219
 
220
+ regressiontest:
221
+ $(MAKE) -C $(FUZZDIR) regressiontest
222
+
223
+ uasanregressiontest:
224
+ $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined"
225
+
226
+ msanregressiontest:
227
+ $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory"
228
+
203
229
  # run UBsan with -fsanitize-recover=signed-integer-overflow
204
230
  # due to a bug in UBsan when doing pointer subtraction
205
231
  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303
@@ -214,10 +240,10 @@ asan-%: clean
214
240
  LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $*
215
241
 
216
242
  msan: clean
217
- $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" # datagen.c fails this test for no obvious reason
243
+ $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason
218
244
 
219
245
  msan-%: clean
220
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" $(MAKE) -C $(TESTDIR) $*
246
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $*
221
247
 
222
248
  asan32: clean
223
249
  $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address"
@@ -226,10 +252,11 @@ uasan: clean
226
252
  $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined"
227
253
 
228
254
  uasan-%: clean
229
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-Og -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $*
255
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $*
230
256
 
231
257
  tsan-%: clean
232
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $*
258
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests
259
+
233
260
  apt-install:
234
261
  sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES)
235
262
 
@@ -258,58 +285,62 @@ gpp6install: apt-add-repo
258
285
  clang38install:
259
286
  APT_PACKAGES="clang-3.8" $(MAKE) apt-install
260
287
 
288
+ # Ubuntu 14.04 ships a too-old lz4
289
+ lz4install:
290
+ [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install
291
+
261
292
  endif
262
293
 
263
294
 
264
295
  ifneq (,$(filter MSYS%,$(shell uname)))
265
296
  HOST_OS = MSYS
266
- CMAKE_PARAMS = -G"MSYS Makefiles"
297
+ CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
267
298
  endif
268
299
 
269
300
 
270
301
  #------------------------------------------------------------------------
271
- #make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
302
+ # target specific tests
272
303
  #------------------------------------------------------------------------
273
304
  ifneq (,$(filter $(HOST_OS),MSYS POSIX))
274
305
  cmakebuild:
275
306
  cmake --version
276
307
  $(RM) -r $(BUILDIR)/cmake/build
277
308
  mkdir $(BUILDIR)/cmake/build
278
- cd $(BUILDIR)/cmake/build ; cmake -DPREFIX:STRING=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall
309
+ cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall
279
310
 
280
311
  c90build: clean
281
- gcc -v
312
+ $(CC) -v
282
313
  CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long`
283
314
 
284
315
  gnu90build: clean
285
- gcc -v
316
+ $(CC) -v
286
317
  CFLAGS="-std=gnu90" $(MAKE) allmost
287
318
 
288
319
  c99build: clean
289
- gcc -v
320
+ $(CC) -v
290
321
  CFLAGS="-std=c99" $(MAKE) allmost
291
322
 
292
323
  gnu99build: clean
293
- gcc -v
324
+ $(CC) -v
294
325
  CFLAGS="-std=gnu99" $(MAKE) allmost
295
326
 
296
327
  c11build: clean
297
- gcc -v
328
+ $(CC) -v
298
329
  CFLAGS="-std=c11" $(MAKE) allmost
299
330
 
300
331
  bmix64build: clean
301
- gcc -v
332
+ $(CC) -v
302
333
  CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test
303
334
 
304
335
  bmix32build: clean
305
- gcc -v
336
+ $(CC) -v
306
337
  CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test
307
338
 
308
339
  bmi32build: clean
309
- gcc -v
340
+ $(CC) -v
310
341
  CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test
311
342
 
312
343
  staticAnalyze: clean
313
- gcc -v
344
+ $(CC) -v
314
345
  CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all
315
346
  endif
data/contrib/zstd/NEWS CHANGED
@@ -1,3 +1,90 @@
1
+ v1.3.3
2
+ perf: faster zstd_opt strategy (levels 17-19)
3
+ fix : bug #944 : multithreading with shared ditionary and large data, reported by @gsliepen
4
+ cli : fix : content size written in header by default
5
+ cli : fix : improved LZ4 format support, by @felixhandte
6
+ cli : new : hidden command `-S`, to benchmark multiple files while generating one result per file
7
+ api : fix : support large skippable frames, by @terrelln
8
+ api : fix : streaming interface was adding a useless 3-bytes null block to small frames
9
+ api : change : when setting `pledgedSrcSize`, use `ZSTD_CONTENTSIZE_UNKNOWN` macro value to mean "unknown"
10
+ build: fix : compilation under rhel6 and centos6, reported by @pixelb
11
+ build: added `check` target
12
+
13
+ v1.3.2
14
+ new : long range mode, using --long command, by Stella Lau (@stellamplau)
15
+ new : ability to generate and decode magicless frames (#591)
16
+ changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode
17
+ fix : multi-threading compression works with custom allocators
18
+ fix : ZSTD_sizeof_CStream() was over-evaluating memory usage
19
+ fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22)
20
+ fix : 32-bits build can now decode large offsets (levels 21+)
21
+ cli : added LZ4 frame support by default, by Felix Handte (@felixhandte)
22
+ cli : improved --list output
23
+ cli : new : can split input file for dictionary training, using command -B#
24
+ cli : new : clean operation artefact on Ctrl-C interruption
25
+ cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851)
26
+ cli : fix : write file size in header in multiple-files mode
27
+ api : added macro ZSTD_COMPRESSBOUND() for static allocation
28
+ api : experimental : new advanced decompression API
29
+ api : fix : sizeof_CCtx() used to over-estimate
30
+ build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819)
31
+ build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818)
32
+ example : added streaming_memory_usage
33
+ license : changed /examples license to BSD + GPLv2
34
+ license : fix a few header files to reflect new license (#825)
35
+
36
+ v1.3.1
37
+ New license : BSD + GPLv2
38
+ perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk)
39
+ perf: Multi-threading supports up to 256 threads. Cap at 256 when more are requested (#760)
40
+ cli : improved and fixed --list command, by @ib (#772)
41
+ cli : command -vV to list supported formats, by @ib (#771)
42
+ build : fixed binary variants, reported by @svenha (#788)
43
+ build : fix Visual compilation for non x86/x64 targets, reported by Greg Slazinski (@GregSlazinski) (#718)
44
+ API exp : breaking change : ZSTD_getframeHeader() provides more information
45
+ API exp : breaking change : pinned down values of error codes
46
+ doc : fixed huffman example, by Ulrich Kunitz (@ulikunitz)
47
+ new : contrib/adaptive-compression, I/O driven compression strength, by Paul Cruz (@paulcruz74)
48
+ new : contrib/long_distance_matching, statistics by Stella Lau (@stellamplau)
49
+ updated : contrib/linux-kernel, by Nick Terrell (@terrelln)
50
+
51
+ v1.3.0
52
+ cli : new : `--list` command, by Paul Cruz
53
+ cli : changed : xz/lzma support enabled by default
54
+ cli : changed : `-t *` continue processing list after a decompression error
55
+ API : added : ZSTD_versionString()
56
+ API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell
57
+ API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter()
58
+ API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx()
59
+ API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700)
60
+ API exp : clarified memory estimation / measurement functions.
61
+ API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1
62
+ tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz
63
+ new : contrib/seekable_format, demo and API, by Sean Purcell
64
+ changed : contrib/linux-kernel, updated version and license, by Nick Terrell
65
+
66
+ v1.2.0
67
+ cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable)
68
+ cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell
69
+ cli : new : zstdmt symlink hardwired to `zstd -T0`
70
+ cli : new : command --threads=# (#671)
71
+ cli : changed : cover dictionary builder by default, for improved quality, by Nick Terrell
72
+ cli : new : commands --train-cover and --train-legacy, to select dictionary algorithm and parameters
73
+ cli : experimental targets `zstd4` and `xzstd4`, with support for lz4 format, by Sean Purcell
74
+ cli : fix : does not output compressed data on console
75
+ cli : fix : ignore symbolic links unless --force specified,
76
+ API : breaking change : ZSTD_createCDict_advanced(), only use compressionParameters as argument
77
+ API : added : prototypes ZSTD_*_usingCDict_advanced(), for direct control over frameParameters.
78
+ API : improved: ZSTDMT_compressCCtx() reduced memory usage
79
+ API : fix : ZSTDMT_compressCCtx() now provides srcSize in header (#634)
80
+ API : fix : src size stored in frame header is controlled at end of frame
81
+ API : fix : enforced consistent rules for pledgedSrcSize==0 (#641)
82
+ API : fix : error code "GENERIC" replaced by "dstSizeTooSmall" when appropriate
83
+ build: improved cmake script, by @Majlen
84
+ build: enabled Multi-threading support for *BSD, by Baptiste Daroussin
85
+ tools: updated Paramgrill. Command -O# provides best parameters for sample and speed target.
86
+ new : contrib/linux-kernel version, by Nick Terrell
87
+
1
88
  v1.1.4
2
89
  cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski
3
90
  cli : new : advanced benchmark command --priority=rt
@@ -5,13 +92,13 @@ cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77
5
92
  cli : fix : --rm remains silent when input is stdin
6
93
  cli : experimental : xzstd, with support for xz/lzma decoding, by Przemyslaw Skibinski
7
94
  speed : improved decompression speed in streaming mode for single shot scenarios (+5%)
8
- memory : DDict (decompression dictionary) memory usage down from 150 KB to 20 KB
9
- arch : 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell
95
+ memory: DDict (decompression dictionary) memory usage down from 150 KB to 20 KB
96
+ arch: 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell
10
97
  API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize()
11
98
  API : changed : dropped support of legacy versions <= v0.3 (can be changed by modifying ZSTD_LEGACY_SUPPORT value)
12
- build: new: meson build system in contrib/meson, by Dima Krasner
13
- build: improved cmake script, by @Majlen
14
- build: added -Wformat-security flag, as recommended by Padraig Brady
99
+ build : new: meson build system in contrib/meson, by Dima Krasner
100
+ build : improved cmake script, by @Majlen
101
+ build : added -Wformat-security flag, as recommended by Padraig Brady
15
102
  doc : new : educational decoder, by Sean Purcell
16
103
 
17
104
  v1.1.3
@@ -1,24 +1,33 @@
1
- __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm,
2
- targeting real-time compression scenarios at zlib-level and better compression ratios.
1
+ <p align="center"><img src="https://raw.githubusercontent.com/facebook/zstd/readme/doc/images/zstd_logo86.png" alt="Zstandard"></p>
3
2
 
4
- It is provided as an open-source BSD-licensed **C** library,
5
- and a command line utility producing and decoding `.zst` and `.gz` files.
6
- For other programming languages,
7
- you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages).
3
+ __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm,
4
+ targeting real-time compression scenarios at zlib-level and better compression ratios.
5
+ It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy).
8
6
 
9
- |Branch |Status |
10
- |------------|---------|
11
- |master | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=master)](https://travis-ci.org/facebook/zstd) |
12
- |dev | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=dev)](https://travis-ci.org/facebook/zstd) |
7
+ The project is provided as an open-source BSD-licensed **C** library,
8
+ and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files.
9
+ Should your project require another programming language,
10
+ a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages).
13
11
 
14
- As a reference, several fast compression algorithms were tested and compared
15
- on a server running Linux Mint Debian Edition (`Linux version 4.8.0-1-amd64`),
12
+ Development branch status : [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink]
13
+
14
+ [travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite"
15
+ [travisLink]: https://travis-ci.org/facebook/zstd
16
+ [AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite"
17
+ [AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0
18
+ [CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite"
19
+ [CircleLink]: https://circleci.com/gh/facebook/zstd
20
+
21
+ ### Benchmarks
22
+
23
+ For reference, several fast compression algorithms were tested and compared
24
+ on a server running Linux Debian (`Linux version 4.8.0-1-amd64`),
16
25
  with a Core i7-6700K CPU @ 4.0GHz,
17
- using [lzbench v1.6], an open-source in-memory benchmark by @inikep
26
+ using [lzbench], an open-source in-memory benchmark by @inikep
18
27
  compiled with GCC 6.3.0,
19
28
  on the [Silesia compression corpus].
20
29
 
21
- [lzbench v1.6]: https://github.com/inikep/lzbench
30
+ [lzbench]: https://github.com/inikep/lzbench
22
31
  [Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
23
32
 
24
33
  | Compressor name | Ratio | Compression| Decompress.|
@@ -36,16 +45,23 @@ on the [Silesia compression corpus].
36
45
  [LZ4]: http://www.lz4.org/
37
46
 
38
47
  Zstd can also offer stronger compression ratios at the cost of compression speed.
39
- Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma.
48
+ Speed vs Compression trade-off is configurable by small increments.
49
+ Decompression speed is preserved and remains roughly the same at all settings,
50
+ a property shared by most LZ compression algorithms, such as [zlib] or lzma.
40
51
 
41
- The following tests were run on a Core i7-3930K CPU @ 4.5GHz, using [lzbench], an open-source in-memory benchmark by @inikep compiled with GCC 5.2.1, on the [Silesia compression corpus].
52
+ The following tests were run
53
+ on a server running Linux Debian (`Linux version 4.8.0-1-amd64`)
54
+ with a Core i7-6700K CPU @ 4.0GHz,
55
+ using [lzbench], an open-source in-memory benchmark by @inikep
56
+ compiled with GCC 6.3.0,
57
+ on the [Silesia compression corpus].
42
58
 
43
59
  Compression Speed vs Ratio | Decompression Speed
44
60
  ---------------------------|--------------------
45
61
  ![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed")
46
62
 
47
- Several algorithms can produce higher compression ratios, but at slower speeds, falling outside of the graph.
48
- For a larger picture including very slow modes, [click on this link](doc/images/DCspeed5.png) .
63
+ A few other algorithms can produce higher compression ratios at slower speeds, falling outside of the graph.
64
+ For a larger picture including slow modes, [click on this link](doc/images/DCspeed5.png).
49
65
 
50
66
 
51
67
  ### The case for Small Data compression
@@ -55,11 +71,11 @@ Previous charts provide results applicable to typical file and stream scenarios
55
71
  The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon.
56
72
 
57
73
  To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data.
58
- Training Zstandard is achieved by provide it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression.
74
+ Training Zstandard is achieved by providing it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression.
59
75
  Using this dictionary, the compression ratio achievable on small data improves dramatically.
60
76
 
61
77
  The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users).
62
- It consists of roughly 10K records weighting about 1KB each.
78
+ It consists of roughly 10K records weighing about 1KB each.
63
79
 
64
80
  Compression Ratio | Compression Speed | Decompression Speed
65
81
  ------------------|-------------------|--------------------
@@ -72,7 +88,7 @@ Training works if there is some correlation in a family of small data samples. T
72
88
  Hence, deploying one dictionary per type of data will provide the greatest benefits.
73
89
  Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file.
74
90
 
75
- #### Dictionary compression How To :
91
+ #### Dictionary compression How To:
76
92
 
77
93
  1) Create the dictionary
78
94
 
@@ -87,19 +103,16 @@ Dictionary gains are mostly effective in the first few KB. Then, the compression
87
103
  `zstd -D dictionaryName --decompress FILE.zst`
88
104
 
89
105
 
90
- ### Build
91
-
92
- Once you have the repository cloned, there are multiple ways provided to build Zstandard.
106
+ ### Build instructions
93
107
 
94
108
  #### Makefile
95
109
 
96
- If your system is compatible with a standard `make` (or `gmake`) binary generator,
97
- you can simply run it at the root directory.
98
- It will generate `zstd` within root directory.
110
+ If your system is compatible with standard `make` (or `gmake`),
111
+ invoking `make` in root directory will generate `zstd` cli in root directory.
99
112
 
100
- Other available options include :
101
- - `make install` : create and install zstd binary, library and man page
102
- - `make test` : create and run `zstd` and test tools on local platform
113
+ Other available options include:
114
+ - `make install` : create and install zstd cli, library and man pages
115
+ - `make check` : create and run `zstd`, tests its behavior on local platform
103
116
 
104
117
  #### cmake
105
118
 
@@ -113,29 +126,25 @@ A Meson project is provided within `contrib/meson`.
113
126
 
114
127
  #### Visual Studio (Windows)
115
128
 
116
- Going into `build` directory, you will find additional possibilities :
117
- - Projects for Visual Studio 2005, 2008 and 2010
118
- + VS2010 project is compatible with VS2012, VS2013 and VS2015
129
+ Going into `build` directory, you will find additional possibilities:
130
+ - Projects for Visual Studio 2005, 2008 and 2010.
131
+ + VS2010 project is compatible with VS2012, VS2013 and VS2015.
119
132
  - Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`,
120
133
  which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution.
121
134
 
122
135
 
123
136
  ### Status
124
137
 
125
- Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases.
138
+ Zstandard is currently deployed within Facebook. It is used continuously to compress large amounts of data in multiple formats and use cases.
126
139
  Zstandard is considered safe for production environments.
127
140
 
128
141
  ### License
129
142
 
130
- Zstandard is [BSD-licensed](LICENSE). We also provide an [additional patent grant](PATENTS).
143
+ Zstandard is dual-licensed under [BSD](LICENSE) and [GPLv2](COPYING).
131
144
 
132
145
  ### Contributing
133
146
 
134
- The "dev" branch is the one where all contributions will be merged before reaching "master".
135
- If you plan to propose a patch, please commit into the "dev" branch or its own feature branch.
147
+ The "dev" branch is the one where all contributions are merged before reaching "master".
148
+ If you plan to propose a patch, please commit into the "dev" branch, or its own feature branch.
136
149
  Direct commit to "master" are not permitted.
137
150
  For more information, please read [CONTRIBUTING](CONTRIBUTING.md).
138
-
139
- ### Miscellaneous
140
-
141
- Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entropy library](https://github.com/Cyan4973/FiniteStateEntropy).