extlz4 0.2.5 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.ja.md +16 -1
- data/README.md +49 -51
- data/Rakefile +22 -0
- data/bin/extlz4 +1 -1
- data/contrib/lz4/LICENSE +2 -1
- data/contrib/lz4/Makefile.inc +111 -0
- data/contrib/lz4/NEWS +97 -0
- data/contrib/lz4/README.md +41 -36
- data/contrib/lz4/build/README.md +55 -0
- data/contrib/lz4/build/VS2010/datagen/datagen.vcxproj +169 -0
- data/contrib/lz4/build/VS2010/frametest/frametest.vcxproj +176 -0
- data/contrib/lz4/build/VS2010/fullbench/fullbench.vcxproj +176 -0
- data/contrib/lz4/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +180 -0
- data/contrib/lz4/build/VS2010/fuzzer/fuzzer.vcxproj +173 -0
- data/contrib/lz4/build/VS2010/liblz4/liblz4.vcxproj +175 -0
- data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.rc +51 -0
- data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.vcxproj +179 -0
- data/contrib/lz4/build/VS2010/lz4/lz4.rc +51 -0
- data/contrib/lz4/build/VS2010/lz4/lz4.vcxproj +189 -0
- data/contrib/lz4/build/VS2010/lz4.sln +98 -0
- data/contrib/lz4/build/VS2017/datagen/datagen.vcxproj +173 -0
- data/contrib/lz4/build/VS2017/frametest/frametest.vcxproj +180 -0
- data/contrib/lz4/build/VS2017/fullbench/fullbench.vcxproj +180 -0
- data/contrib/lz4/build/VS2017/fullbench-dll/fullbench-dll.vcxproj +184 -0
- data/contrib/lz4/build/VS2017/fuzzer/fuzzer.vcxproj +177 -0
- data/contrib/lz4/build/VS2017/liblz4/liblz4.vcxproj +179 -0
- data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.rc +51 -0
- data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.vcxproj +183 -0
- data/contrib/lz4/build/VS2017/lz4/lz4.rc +51 -0
- data/contrib/lz4/build/VS2017/lz4/lz4.vcxproj +175 -0
- data/contrib/lz4/build/VS2017/lz4.sln +103 -0
- data/contrib/lz4/build/VS2022/datagen/datagen.vcxproj +173 -0
- data/contrib/lz4/build/VS2022/frametest/frametest.vcxproj +180 -0
- data/contrib/lz4/build/VS2022/fullbench/fullbench.vcxproj +180 -0
- data/contrib/lz4/build/VS2022/fullbench-dll/fullbench-dll.vcxproj +184 -0
- data/contrib/lz4/build/VS2022/fuzzer/fuzzer.vcxproj +177 -0
- data/contrib/lz4/build/VS2022/liblz4/liblz4.vcxproj +179 -0
- data/contrib/lz4/build/VS2022/liblz4-dll/liblz4-dll.rc +51 -0
- data/contrib/lz4/build/VS2022/liblz4-dll/liblz4-dll.vcxproj +183 -0
- data/contrib/lz4/build/VS2022/lz4.sln +103 -0
- data/contrib/lz4/build/cmake/CMakeLists.txt +273 -0
- data/contrib/lz4/build/cmake/lz4Config.cmake.in +2 -0
- data/contrib/lz4/lib/LICENSE +1 -1
- data/contrib/lz4/lib/README.md +111 -15
- data/contrib/lz4/lib/liblz4-dll.rc.in +35 -0
- data/contrib/lz4/lib/liblz4.pc.in +3 -3
- data/contrib/lz4/lib/lz4.c +1891 -733
- data/contrib/lz4/lib/lz4.h +597 -234
- data/contrib/lz4/lib/lz4file.c +311 -0
- data/contrib/lz4/lib/lz4file.h +93 -0
- data/contrib/lz4/lib/lz4frame.c +896 -493
- data/contrib/lz4/lib/lz4frame.h +408 -107
- data/contrib/lz4/lib/lz4frame_static.h +5 -112
- data/contrib/lz4/lib/lz4hc.c +1039 -301
- data/contrib/lz4/lib/lz4hc.h +264 -123
- data/contrib/lz4/lib/xxhash.c +376 -240
- data/contrib/lz4/lib/xxhash.h +128 -93
- data/contrib/lz4/ossfuzz/Makefile +79 -0
- data/contrib/lz4/ossfuzz/compress_frame_fuzzer.c +48 -0
- data/contrib/lz4/ossfuzz/compress_fuzzer.c +58 -0
- data/contrib/lz4/ossfuzz/compress_hc_fuzzer.c +64 -0
- data/contrib/lz4/ossfuzz/decompress_frame_fuzzer.c +75 -0
- data/contrib/lz4/ossfuzz/decompress_fuzzer.c +78 -0
- data/contrib/lz4/ossfuzz/fuzz.h +48 -0
- data/contrib/lz4/ossfuzz/fuzz_data_producer.c +77 -0
- data/contrib/lz4/ossfuzz/fuzz_data_producer.h +36 -0
- data/contrib/lz4/ossfuzz/fuzz_helpers.h +95 -0
- data/contrib/lz4/ossfuzz/lz4_helpers.c +51 -0
- data/contrib/lz4/ossfuzz/lz4_helpers.h +13 -0
- data/contrib/lz4/ossfuzz/ossfuzz.sh +23 -0
- data/contrib/lz4/ossfuzz/round_trip_frame_fuzzer.c +43 -0
- data/contrib/lz4/ossfuzz/round_trip_frame_uncompressed_fuzzer.c +134 -0
- data/contrib/lz4/ossfuzz/round_trip_fuzzer.c +117 -0
- data/contrib/lz4/ossfuzz/round_trip_hc_fuzzer.c +44 -0
- data/contrib/lz4/ossfuzz/round_trip_stream_fuzzer.c +302 -0
- data/contrib/lz4/ossfuzz/standaloneengine.c +74 -0
- data/contrib/lz4/ossfuzz/travisoss.sh +26 -0
- data/ext/blockapi.c +13 -48
- data/ext/extlz4.c +2 -0
- data/ext/extlz4.h +17 -0
- data/ext/frameapi.c +3 -14
- data/ext/hashargs.c +9 -3
- data/ext/hashargs.h +1 -1
- data/ext/lz4_amalgam.c +0 -23
- data/gemstub.rb +5 -16
- data/lib/extlz4/oldstream.rb +1 -1
- data/lib/extlz4.rb +51 -3
- data/test/common.rb +2 -2
- metadata +84 -16
- data/contrib/lz4/circle.yml +0 -38
- data/contrib/lz4/lib/lz4opt.h +0 -356
- data/lib/extlz4/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 960dfd2d3d26080ed4115e4e5131c510a28f4415054deead1dc4f7563163d43e
|
4
|
+
data.tar.gz: c421de615b4ad2c71e4e4645f0ca94f3426aadc354350a0365ddd6912c472d10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70cde50167bc57e50a63148b9beb3e662007b5d50bfd902108d0de8cd28214a05620b3df7c52e71d01fc3ea73250b78103b93cc625dd9d7a62c3a042f63f85ad
|
7
|
+
data.tar.gz: df0df6e229d8ee0a5f1f1f4b229fc7558385ea0a8453dc242558946bb7c29ab8e1c84dbf46d745f07afa627456dd5d872e29287c3c63801ead1325088bd28fce
|
data/HISTORY.ja.md
CHANGED
@@ -1,4 +1,19 @@
|
|
1
|
-
# extlz4-0.
|
1
|
+
# extlz4-0.3.1 (令和2年6月7日)
|
2
|
+
|
3
|
+
* lz4-1.9.2 に更新
|
4
|
+
* `extlz4.so` が `<extlz4-dir>/lib` へ置かれない環境に対応
|
5
|
+
* https://github.com/dearblue/ruby-extlz4/issues/2
|
6
|
+
|
7
|
+
|
8
|
+
# extlz4-0.3 (平成31年4月)
|
9
|
+
|
10
|
+
* lz4-1.9.0 に更新
|
11
|
+
* `LZ4` モジュールをリファインメントとして利用できるように機能を追加
|
12
|
+
* `Object` および `String` クラスで `.to_lz4frame` `.unlz4frame` メソッドが利用できるようになりました。
|
13
|
+
* `String` クラスで `.to_lz4block` `.unlz4block` メソッドが利用できるようになりました。
|
14
|
+
|
15
|
+
|
16
|
+
# extlz4-0.2.5 (平成30年1月14日 日曜日)
|
2
17
|
|
3
18
|
* lz4 ライブラリを [1.8.1](https://github.com/lz4/lz4/releases/tag/v1.8.1) に更新
|
4
19
|
|
data/README.md
CHANGED
@@ -5,28 +5,28 @@
|
|
5
5
|
|
6
6
|
LZ4 データストリームを圧縮・伸張できます。lz4-cli で扱うことが出来ます。
|
7
7
|
|
8
|
-
```
|
8
|
+
```shell:shell
|
9
9
|
$ dmesg | ruby -r extlz4 -e 'LZ4.encode_file($stdin.binmode, $stdout.binmode)' | lz4c -d | more
|
10
10
|
```
|
11
11
|
|
12
12
|
ほかの ruby 向けの lz4 バインディングライブラリとしては KOMIYA Atsushi さんによる [lz4-ruby (http://rubygems.org/gems/lz4-ruby)](http://rubygems.org/gems/lz4-ruby) があります。
|
13
13
|
|
14
14
|
|
15
|
-
##
|
16
|
-
|
17
|
-
*
|
18
|
-
|
19
|
-
|
20
|
-
*
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
*
|
28
|
-
|
29
|
-
|
15
|
+
## FEATURES (機能)
|
16
|
+
|
17
|
+
* Generic LZ4 frame data process (for `.lz4` file format)
|
18
|
+
* Decode LZ4 Frame data : `LZ4.decode`
|
19
|
+
* Encode LZ4 Frame data : `LZ4.encode`
|
20
|
+
* Generic LZ4 frame data file process (for `.lz4` file format)
|
21
|
+
* Decode LZ4 Frame data file : `LZ4.decode_file`
|
22
|
+
* Encode LZ4 Frame data file : `LZ4.encode_file`
|
23
|
+
* LZ4 block data process
|
24
|
+
* Decode LZ4 block data : `LZ4.block_decode`
|
25
|
+
* Encode LZ4 block data : `LZ4.block_encode` (supporting high compression level)
|
26
|
+
* Streaming Decode LZ4 block data : `LZ4.block_stream_decode` and `LZ4::BlockDecoder#update`
|
27
|
+
* Streaming Encode LZ4 block data : `LZ4.block_stream_encode` and `LZ4::BlockEncoder#update` (supporting high compression level)
|
28
|
+
|
29
|
+
See [Quick reference](QUICKREF.md) for more details.
|
30
30
|
|
31
31
|
|
32
32
|
## ATTENTIONS (注意事項)
|
@@ -59,31 +59,6 @@ extlz4-0.1.1 でその不具合の修正を行いました。
|
|
59
59
|
修復できるのはあくまで extlz4-0.1 のこの不具合に起因するファイルのみとなります。
|
60
60
|
|
61
61
|
|
62
|
-
## FEATURES (機能)
|
63
|
-
|
64
|
-
* Generic LZ4 frame data process
|
65
|
-
* Decode LZ4 Frame data : LZ4.decode
|
66
|
-
* Encode LZ4 Frame data : LZ4.encode
|
67
|
-
* Generic LZ4 frame data file process
|
68
|
-
* Decode LZ4 Frame data file : LZ4.decode\_file
|
69
|
-
* Encode LZ4 Frame data file : LZ4.encode\_file
|
70
|
-
* LZ4 block data process
|
71
|
-
* Decode LZ4 block data : LZ4.block\_decode
|
72
|
-
* Encode LZ4 block data : LZ4.block\_encode (supporting high compression level)
|
73
|
-
* Streaming Decode LZ4 block data : LZ4.block\_stream\_decode and LZ4::BlockDecoder#update
|
74
|
-
* Streaming Encode LZ4 block data : LZ4.block\_stream\_encode and LZ4::BlockEncoder#update (supporting high compression level)
|
75
|
-
|
76
|
-
|
77
|
-
## ABOUT TAINT STATE AND SECURITY (汚染状態とセキュリティについて)
|
78
|
-
|
79
|
-
extlz4 はオブジェクト間での汚染状態を一方向伝播します。
|
80
|
-
|
81
|
-
オブジェクトの汚染伝播については『入力 -> 出力』となり、
|
82
|
-
ストリーム処理の場合は『入力 -> 圧縮器・伸張器 -> 出力』というようになります。
|
83
|
-
|
84
|
-
セキュリティレベルによる処理の拒否は行いません。
|
85
|
-
|
86
|
-
|
87
62
|
## EXAMPLES (用例)
|
88
63
|
|
89
64
|
First, load extlz4. (最初に extlz4 を読み込んでください)
|
@@ -92,25 +67,25 @@ First, load extlz4. (最初に extlz4 を読み込んでください)
|
|
92
67
|
require "extlz4"
|
93
68
|
```
|
94
69
|
|
95
|
-
###
|
70
|
+
### One shot decoding from LZ4 Frame (LZ4 Frame 伸張処理)
|
96
71
|
|
97
72
|
``` ruby:ruby
|
98
73
|
uncompressed_data_string = LZ4.decode(compressed_data_string)
|
99
74
|
```
|
100
75
|
|
101
|
-
###
|
76
|
+
### One shot encoding to LZ4 Frame (LZ4 Frame 通常圧縮処理)
|
102
77
|
|
103
78
|
``` ruby:ruby
|
104
79
|
compressed_data_string = LZ4.encode(uncompressed_data_string)
|
105
80
|
```
|
106
81
|
|
107
|
-
###
|
82
|
+
### One shot high compression encoding to LZ4 Frame (LZ4 Frame 高圧縮処理)
|
108
83
|
|
109
84
|
``` ruby:ruby
|
110
85
|
compressed_data_string = LZ4.encode(uncompressed_data_string, 9)
|
111
86
|
```
|
112
87
|
|
113
|
-
###
|
88
|
+
### Stream decoding to LZ4 Frame
|
114
89
|
|
115
90
|
``` ruby:ruby
|
116
91
|
File.open("sample.txt.lz4", "rb") do |file|
|
@@ -122,7 +97,7 @@ File.open("sample.txt.lz4", "rb") do |file|
|
|
122
97
|
end
|
123
98
|
```
|
124
99
|
|
125
|
-
###
|
100
|
+
### Stream encoding by high compression to LZ4 Frame
|
126
101
|
|
127
102
|
``` ruby:ruby
|
128
103
|
File.open("sample.txt.lz4", "wb") do |file|
|
@@ -133,7 +108,7 @@ File.open("sample.txt.lz4", "wb") do |file|
|
|
133
108
|
end
|
134
109
|
```
|
135
110
|
|
136
|
-
###
|
111
|
+
### Stream encoding without block to LZ4 Frame
|
137
112
|
|
138
113
|
``` ruby:ruby
|
139
114
|
file = File.open("sample.txt.lz4", "wb")
|
@@ -142,7 +117,7 @@ lz4 << "abcdefghijklmnopqrstuvwxyz\n"
|
|
142
117
|
lz4.close # VERY IMPORTANT!
|
143
118
|
```
|
144
119
|
|
145
|
-
###
|
120
|
+
### One shot block data processing to/from LZ4 Block (fast compression encoding and decoding)
|
146
121
|
|
147
122
|
``` ruby:ruby
|
148
123
|
src = "abcdefg" * 100
|
@@ -151,7 +126,7 @@ data = LZ4.block_decode(lz4data)
|
|
151
126
|
p src == data # => true
|
152
127
|
```
|
153
128
|
|
154
|
-
###
|
129
|
+
### One shot block data processing to/from LZ4 Block (high compression encoding and decoding)
|
155
130
|
|
156
131
|
``` ruby:ruby
|
157
132
|
src = "abcdefg" * 100
|
@@ -161,7 +136,7 @@ data = LZ4.block_decode(lz4data)
|
|
161
136
|
p src == data # => true
|
162
137
|
```
|
163
138
|
|
164
|
-
###
|
139
|
+
### One shot block data processing to/from LZ4 Block (high speed encoding)
|
165
140
|
|
166
141
|
``` ruby:ruby
|
167
142
|
src = "abcdefg" * 100
|
@@ -169,7 +144,7 @@ level = -19 # transform to one's complement as acceleration
|
|
169
144
|
lz4data = LZ4.block_encode(level, src)
|
170
145
|
```
|
171
146
|
|
172
|
-
### Block stream data processing (high compression encoding and decoding)
|
147
|
+
### Block stream data processing to/from LZ4 Block (high compression encoding and decoding)
|
173
148
|
|
174
149
|
``` ruby:ruby
|
175
150
|
level = 8 # (OPTIONAL PARAMETER)
|
@@ -194,6 +169,11 @@ p src2 == data # => true
|
|
194
169
|
```
|
195
170
|
|
196
171
|
|
172
|
+
## Support `Ractor` with Ruby3
|
173
|
+
|
174
|
+
Ruby3 で追加された `Ractor` に対応しています。
|
175
|
+
|
176
|
+
|
197
177
|
## BONUS (おまけ)
|
198
178
|
|
199
179
|
コマンドラインプログラムとして ``extlz4`` が追加されます。
|
@@ -201,3 +181,21 @@ p src2 == data # => true
|
|
201
181
|
これは lz4 と同程度の機能を持ちます (車輪の再発明とも言う)。
|
202
182
|
|
203
183
|
とはいえ、引数のとり方を変えてあり、gzip のような形で利用できます。
|
184
|
+
|
185
|
+
|
186
|
+
## SPECIFICATION (仕様)
|
187
|
+
|
188
|
+
- package name: extlz4
|
189
|
+
- author: dearblue (mailto:dearblue@users.osdn.me)
|
190
|
+
- project page: <https://github.com/dearblue/ruby-extlz4>
|
191
|
+
- how to install: `gem install extlz4`
|
192
|
+
- version: 0.3.4
|
193
|
+
- product quality: technical preview
|
194
|
+
- licensing: [2 clause BSD License](LICENSE)
|
195
|
+
- dependency gems: none
|
196
|
+
- dependency external c libraries: none
|
197
|
+
- bundled external c libraries (git submodules):
|
198
|
+
- [lz4](https://github.com/lz4/lz4)
|
199
|
+
[version 1.9.3](https://github.com/lz4/lz4/tree/v1.9.3)
|
200
|
+
under [2 clause BSD license](https://github.com/lz4/lz4/blob/v1.9.3/LICENSE)
|
201
|
+
by [Yann Collet](https://github.com/Cyan4973)
|
data/Rakefile
CHANGED
@@ -35,6 +35,7 @@ GEMSTUB.executables.sort!
|
|
35
35
|
PACKAGENAME = "#{GEMSTUB.name}-#{GEMSTUB.version}"
|
36
36
|
GEMFILE = "#{PACKAGENAME}.gem"
|
37
37
|
GEMSPEC = "#{PACKAGENAME}.gemspec"
|
38
|
+
BUNDLER_GEMFILE = "Gemfile"
|
38
39
|
|
39
40
|
GEMSTUB.files += DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + EXTRA
|
40
41
|
GEMSTUB.files.sort!
|
@@ -194,6 +195,9 @@ task "package-name" do
|
|
194
195
|
puts PACKAGENAME
|
195
196
|
end
|
196
197
|
|
198
|
+
desc "generate Gemfile for bundler"
|
199
|
+
task "gemfile" => BUNDLER_GEMFILE
|
200
|
+
|
197
201
|
file GEMFILE => DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + [GEMSPEC] do
|
198
202
|
sh "gem build #{GEMSPEC}"
|
199
203
|
end
|
@@ -210,3 +214,21 @@ end
|
|
210
214
|
file GEMSPEC_TRYOUT => RAKEFILE do
|
211
215
|
File.write(GEMSPEC_TRYOUT, GEMSTUB_TRYOUT.to_ruby, mode: "wb")
|
212
216
|
end
|
217
|
+
|
218
|
+
file BUNDLER_GEMFILE => RAKEFILE do
|
219
|
+
File.write(BUNDLER_GEMFILE, <<~GemfileSource, mode: "wb")
|
220
|
+
source "https://rubygems.org/"
|
221
|
+
|
222
|
+
group "default" do
|
223
|
+
#{GEMSTUB.runtime_dependencies.map { |e|
|
224
|
+
%( gem #{e.name.inspect}, #{e.requirements_list.map { |ee| ee.inspect }.join(", ")})
|
225
|
+
}.join("\n")}
|
226
|
+
end
|
227
|
+
|
228
|
+
group "development", "test" do
|
229
|
+
#{GEMSTUB.development_dependencies.map { |e|
|
230
|
+
%( gem #{e.name.inspect}, #{e.requirements_list.map { |ee| ee.inspect }.join(", ")})
|
231
|
+
}.join("\n")}
|
232
|
+
end
|
233
|
+
GemfileSource
|
234
|
+
end
|
data/bin/extlz4
CHANGED
data/contrib/lz4/LICENSE
CHANGED
@@ -8,4 +8,5 @@ and with presence of COPYING or LICENSE file in associated directories.
|
|
8
8
|
This model is selected to emphasize that
|
9
9
|
files in the `lib` directory are designed to be included into 3rd party applications,
|
10
10
|
while all other files, in `programs`, `tests` or `examples`,
|
11
|
-
|
11
|
+
are intended to be used "as is", as part of their intended scenarios,
|
12
|
+
with no intention to support 3rd party integration use cases.
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# ################################################################
|
2
|
+
# LZ4 - Makefile common definitions
|
3
|
+
# Copyright (C) Yann Collet 2020
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# BSD license
|
7
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
+
# are permitted provided that the following conditions are met:
|
9
|
+
#
|
10
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
11
|
+
# list of conditions and the following disclaimer.
|
12
|
+
#
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice, this
|
14
|
+
# list of conditions and the following disclaimer in the documentation and/or
|
15
|
+
# other materials provided with the distribution.
|
16
|
+
#
|
17
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
18
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
19
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
20
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
21
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
22
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
24
|
+
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
#
|
28
|
+
# You can contact the author at :
|
29
|
+
# - LZ4 source repository : https://github.com/lz4/lz4
|
30
|
+
# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
|
31
|
+
# ################################################################
|
32
|
+
|
33
|
+
UNAME ?= uname
|
34
|
+
|
35
|
+
TARGET_OS ?= $(shell $(UNAME))
|
36
|
+
ifeq ($(TARGET_OS),)
|
37
|
+
TARGET_OS ?= $(OS)
|
38
|
+
endif
|
39
|
+
|
40
|
+
ifneq (,$(filter Windows%,$(TARGET_OS)))
|
41
|
+
LIBLZ4 = liblz4-$(LIBVER_MAJOR)
|
42
|
+
LIBLZ4_EXP = liblz4.lib
|
43
|
+
WINBASED = yes
|
44
|
+
else
|
45
|
+
LIBLZ4_EXP = liblz4.dll.a
|
46
|
+
ifneq (,$(filter MINGW%,$(TARGET_OS)))
|
47
|
+
LIBLZ4 = liblz4
|
48
|
+
WINBASED = yes
|
49
|
+
else
|
50
|
+
ifneq (,$(filter MSYS%,$(TARGET_OS)))
|
51
|
+
LIBLZ4 = msys-lz4-$(LIBVER_MAJOR)
|
52
|
+
WINBASED = yes
|
53
|
+
else
|
54
|
+
ifneq (,$(filter CYGWIN%,$(TARGET_OS)))
|
55
|
+
LIBLZ4 = cyglz4-$(LIBVER_MAJOR)
|
56
|
+
WINBASED = yes
|
57
|
+
else
|
58
|
+
LIBLZ4 = liblz4.$(SHARED_EXT_VER)
|
59
|
+
WINBASED = no
|
60
|
+
EXT =
|
61
|
+
endif
|
62
|
+
endif
|
63
|
+
endif
|
64
|
+
endif
|
65
|
+
|
66
|
+
ifeq ($(WINBASED),yes)
|
67
|
+
EXT = .exe
|
68
|
+
WINDRES = windres
|
69
|
+
endif
|
70
|
+
|
71
|
+
#determine if dev/nul based on host environment
|
72
|
+
ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
|
73
|
+
VOID := /dev/null
|
74
|
+
else
|
75
|
+
ifneq (,$(filter Windows%,$(OS)))
|
76
|
+
VOID := nul
|
77
|
+
else
|
78
|
+
VOID := /dev/null
|
79
|
+
endif
|
80
|
+
endif
|
81
|
+
|
82
|
+
ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW% CYGWIN% MSYS%,$(shell $(UNAME))))
|
83
|
+
POSIX_ENV = Yes
|
84
|
+
else
|
85
|
+
POSIX_ENV = No
|
86
|
+
endif
|
87
|
+
|
88
|
+
# Avoid symlinks when targeting Windows or building on a Windows host
|
89
|
+
ifeq ($(WINBASED),yes)
|
90
|
+
LN_SF = cp -p
|
91
|
+
else
|
92
|
+
ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
|
93
|
+
LN_SF = cp -p
|
94
|
+
else
|
95
|
+
ifneq (,$(filter Windows%,$(OS)))
|
96
|
+
LN_SF = cp -p
|
97
|
+
else
|
98
|
+
LN_SF = ln -sf
|
99
|
+
endif
|
100
|
+
endif
|
101
|
+
endif
|
102
|
+
|
103
|
+
ifneq (,$(filter $(shell $(UNAME)),SunOS))
|
104
|
+
INSTALL ?= ginstall
|
105
|
+
else
|
106
|
+
INSTALL ?= install
|
107
|
+
endif
|
108
|
+
|
109
|
+
INSTALL_PROGRAM ?= $(INSTALL) -m 755
|
110
|
+
INSTALL_DATA ?= $(INSTALL) -m 644
|
111
|
+
INSTALL_DIR ?= $(INSTALL) -d -m 755
|
data/contrib/lz4/NEWS
CHANGED
@@ -1,3 +1,100 @@
|
|
1
|
+
v1.9.4
|
2
|
+
perf : faster decoding speed (~+20%) on aarch64 platforms
|
3
|
+
perf : faster decoding speed (~+70%) for -BD4 setting in CLI
|
4
|
+
api : new function `LZ4_decompress_safe_partial_usingDict()` by @yawqi
|
5
|
+
api : lz4frame: ability to provide custom allocators at state creation
|
6
|
+
api : can skip checksum validation for improved decoding speed
|
7
|
+
api : new experimental unit `lz4file` for file i/o API, by @anjiahao1
|
8
|
+
api : new experimental function `LZ4F_uncompressedUpdate()`, by @alexmohr
|
9
|
+
cli : `--list` works on `stdin` input, by @Low-power
|
10
|
+
cli : `--no-crc` does not produce (compression) nor check (decompression) checksums
|
11
|
+
cli : fix: `--test` and `--list` produce an error code when parsing invalid input
|
12
|
+
cli : fix: support skippable frames when passed via `stdin`, reported by @davidmankin
|
13
|
+
build: fix: Makefile respects CFLAGS directives passed via environment variable
|
14
|
+
build: `LZ4_FREESTANDING`, new build macro for freestanding environments, by @t-mat
|
15
|
+
build: `make` and `make test` are compatible with `-j` parallel run
|
16
|
+
build: AS/400 compatibility, by @jonrumsey
|
17
|
+
build: Solaris 10 compatibility, by @pekdon
|
18
|
+
build: MSVC 2022 support, by @t-mat
|
19
|
+
build: improved meson script, by @eli-schwartz
|
20
|
+
doc : Updated LZ4 block format, provide an "implementation notes" section
|
21
|
+
|
22
|
+
v1.9.3
|
23
|
+
perf: highly improved speed in kernel space, by @terrelln
|
24
|
+
perf: faster speed with Visual Studio, thanks to @wolfpld and @remittor
|
25
|
+
perf: improved dictionary compression speed, by @felixhandte
|
26
|
+
perf: fixed LZ4_compress_HC_destSize() ratio, detected by @hsiangkao
|
27
|
+
perf: reduced stack usage in high compression mode, by @Yanpas
|
28
|
+
api : LZ4_decompress_safe_partial() supports unknown compressed size, requested by @jfkthame
|
29
|
+
api : improved LZ4F_compressBound() with automatic flushing, by Christopher Harvie
|
30
|
+
api : can (de)compress to/from NULL without UBs
|
31
|
+
api : fix alignment test on 32-bit systems (state initialization)
|
32
|
+
api : fix LZ4_saveDictHC() in corner case scenario, detected by @IgorKorkin
|
33
|
+
cli : `-l` legacy format is now compatible with `-m` multiple files, by Filipe Calasans
|
34
|
+
cli : benchmark mode supports dictionary, by @rkoradi
|
35
|
+
cli : fix --fast with large argument, detected by @picoHz
|
36
|
+
build: link to user-defined memory functions with LZ4_USER_MEMORY_FUNCTIONS, suggested by Yuriy Levchenko
|
37
|
+
build: contrib/cmake_unofficial/ moved to build/cmake/
|
38
|
+
build: visual/* moved to build/
|
39
|
+
build: updated meson script, by @neheb
|
40
|
+
build: tinycc support, by Anton Kochkov
|
41
|
+
install: Haiku support, by Jerome Duval
|
42
|
+
doc : updated LZ4 frame format, clarify EndMark
|
43
|
+
|
44
|
+
v1.9.2
|
45
|
+
fix : out-of-bound read in exceptional circumstances when using decompress_partial(), by @terrelln
|
46
|
+
fix : slim opportunity for out-of-bound write with compress_fast() with a large enough input and when providing an output smaller than recommended (< LZ4_compressBound(inputSize)), by @terrelln
|
47
|
+
fix : rare data corruption bug with LZ4_compress_destSize(), by @terrelln
|
48
|
+
fix : data corruption bug when Streaming with an Attached Dict in HC Mode, by @felixhandte
|
49
|
+
perf: enable LZ4_FAST_DEC_LOOP on aarch64/GCC by default, by @prekageo
|
50
|
+
perf: improved lz4frame streaming API speed, by @dreambottle
|
51
|
+
perf: speed up lz4hc on slow patterns when using external dictionary, by @terrelln
|
52
|
+
api: better in-place decompression and compression support
|
53
|
+
cli : --list supports multi-frames files, by @gstedman
|
54
|
+
cli: --version outputs to stdout
|
55
|
+
cli : add option --best as an alias of -12 , by @Low-power
|
56
|
+
misc: Integration into oss-fuzz by @cmeister2, expanded list of scenarios by @terrelln
|
57
|
+
|
58
|
+
v1.9.1
|
59
|
+
fix : decompression functions were reading a few bytes beyond input size (introduced in v1.9.0, reported by @ppodolsky and @danlark1)
|
60
|
+
api : fix : lz4frame initializers compatibility with c++, reported by @degski
|
61
|
+
cli : added command --list, based on a patch by @gabrielstedman
|
62
|
+
build: improved Windows build, by @JPeterMugaas
|
63
|
+
build: AIX, by Norman Green
|
64
|
+
|
65
|
+
v1.9.0
|
66
|
+
perf: large decompression speed improvement on x86/x64 (up to +20%) by @djwatson
|
67
|
+
api : changed : _destSize() compression variants are promoted to stable API
|
68
|
+
api : new : LZ4_initStream(HC), replacing LZ4_resetStream(HC)
|
69
|
+
api : changed : LZ4_resetStream(HC) as recommended reset function, for better performance on small data
|
70
|
+
cli : support custom block sizes, by @blezsan
|
71
|
+
build: source code can be amalgamated, by Bing Xu
|
72
|
+
build: added meson build, by @lzutao
|
73
|
+
build: new build macros : LZ4_DISTANCE_MAX, LZ4_FAST_DEC_LOOP
|
74
|
+
install: MidnightBSD, by @laffer1
|
75
|
+
install: msys2 on Windows 10, by @vtorri
|
76
|
+
|
77
|
+
v1.8.3
|
78
|
+
perf: minor decompression speed improvement (~+2%) with gcc
|
79
|
+
fix : corruption in v1.8.2 at level 9 for files > 64KB under rare conditions (#560)
|
80
|
+
cli : new command --fast, by @jennifermliu
|
81
|
+
cli : fixed elapsed time, and added cpu load indicator (on -vv) (#555)
|
82
|
+
api : LZ4_decompress_safe_partial() now decodes exactly the nb of bytes requested (feature request #566)
|
83
|
+
build : added Haiku target, by @fbrosson, and MidnightBSD, by @laffer1
|
84
|
+
doc : updated documentation regarding dictionary compression
|
85
|
+
|
86
|
+
v1.8.2
|
87
|
+
perf: *much* faster dictionary compression on small files, by @felixhandte
|
88
|
+
perf: improved decompression speed and binary size, by Alexey Tourbin (@svpv)
|
89
|
+
perf: slightly faster HC compression and decompression speed
|
90
|
+
perf: very small compression ratio improvement
|
91
|
+
fix : compression compatible with low memory addresses (< 0xFFFF)
|
92
|
+
fix : decompression segfault when provided with NULL input, by @terrelln
|
93
|
+
cli : new command --favor-decSpeed
|
94
|
+
cli : benchmark mode more accurate for small inputs
|
95
|
+
fullbench : can bench _destSize() variants, by @felixhandte
|
96
|
+
doc : clarified block format parsing restrictions, by Alexey Tourbin (@svpv)
|
97
|
+
|
1
98
|
v1.8.1
|
2
99
|
perf : faster and stronger ultra modes (levels 10+)
|
3
100
|
perf : slightly faster compression and decompression speed
|
data/contrib/lz4/README.md
CHANGED
@@ -2,74 +2,68 @@ LZ4 - Extremely fast compression
|
|
2
2
|
================================
|
3
3
|
|
4
4
|
LZ4 is lossless compression algorithm,
|
5
|
-
providing compression speed
|
5
|
+
providing compression speed > 500 MB/s per core,
|
6
6
|
scalable with multi-cores CPU.
|
7
7
|
It features an extremely fast decoder,
|
8
8
|
with speed in multiple GB/s per core,
|
9
9
|
typically reaching RAM speed limits on multi-core systems.
|
10
10
|
|
11
11
|
Speed can be tuned dynamically, selecting an "acceleration" factor
|
12
|
-
which trades compression ratio for
|
12
|
+
which trades compression ratio for faster speed.
|
13
13
|
On the other end, a high compression derivative, LZ4_HC, is also provided,
|
14
14
|
trading CPU time for improved compression ratio.
|
15
15
|
All versions feature the same decompression speed.
|
16
16
|
|
17
|
+
LZ4 is also compatible with [dictionary compression](https://github.com/facebook/zstd#the-case-for-small-data-compression),
|
18
|
+
both at [API](https://github.com/lz4/lz4/blob/v1.8.3/lib/lz4frame.h#L481) and [CLI](https://github.com/lz4/lz4/blob/v1.8.3/programs/lz4.1.md#operation-modifiers) levels.
|
19
|
+
It can ingest any input file as dictionary, though only the final 64KB are used.
|
20
|
+
This capability can be combined with the [Zstandard Dictionary Builder](https://github.com/facebook/zstd/blob/v1.3.5/programs/zstd.1.md#dictionary-builder),
|
21
|
+
in order to drastically improve compression performance on small files.
|
22
|
+
|
23
|
+
|
17
24
|
LZ4 library is provided as open-source software using BSD 2-Clause license.
|
18
25
|
|
19
26
|
|
20
27
|
|Branch |Status |
|
21
28
|
|------------|---------|
|
22
|
-
|master | [![Build Status][travisMasterBadge]][travisLink] [![Build status][AppveyorMasterBadge]][AppveyorLink] [![coverity][coverBadge]][coverlink] |
|
23
29
|
|dev | [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] |
|
24
30
|
|
25
|
-
[travisMasterBadge]: https://travis-ci.org/lz4/lz4.svg?branch=master "Continuous Integration test suite"
|
26
31
|
[travisDevBadge]: https://travis-ci.org/lz4/lz4.svg?branch=dev "Continuous Integration test suite"
|
27
32
|
[travisLink]: https://travis-ci.org/lz4/lz4
|
28
|
-
[AppveyorMasterBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=master&svg=true "Windows test suite"
|
29
33
|
[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=dev&svg=true "Windows test suite"
|
30
34
|
[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4-1lndh
|
31
|
-
[coverBadge]: https://scan.coverity.com/projects/4735/badge.svg "Static code analysis of Master branch"
|
32
|
-
[coverlink]: https://scan.coverity.com/projects/4735
|
33
35
|
|
34
|
-
> **Branch Policy:**
|
35
|
-
> - The "master" branch is considered stable, at all times.
|
36
|
-
> - The "dev" branch is the one where all contributions must be merged
|
37
|
-
before being promoted to master.
|
38
|
-
> + If you plan to propose a patch, please commit into the "dev" branch,
|
39
|
-
or its own feature branch.
|
40
|
-
Direct commit to "master" are not permitted.
|
41
36
|
|
42
37
|
Benchmarks
|
43
38
|
-------------------------
|
44
39
|
|
45
40
|
The benchmark uses [lzbench], from @inikep
|
46
|
-
compiled with GCC
|
47
|
-
The reference system uses a Core i7-
|
41
|
+
compiled with GCC v8.2.0 on Linux 64-bits (Ubuntu 4.18.0-17).
|
42
|
+
The reference system uses a Core i7-9700K CPU @ 4.9GHz (w/ turbo boost).
|
48
43
|
Benchmark evaluates the compression of reference [Silesia Corpus]
|
49
44
|
in single-thread mode.
|
50
45
|
|
51
46
|
[lzbench]: https://github.com/inikep/lzbench
|
52
47
|
[Silesia Corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
|
53
48
|
|
54
|
-
| Compressor
|
55
|
-
| ----------
|
56
|
-
| memcpy
|
57
|
-
|**LZ4
|
58
|
-
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
| LZF v3.6
|
63
|
-
|
|
64
|
-
|
65
|
-
| [zlib] deflate 1.2.
|
66
|
-
|**LZ4 HC -9 (v1.7.3)** |**2.720**| 34 MB/s | **3240 MB/s** |
|
67
|
-
| [zlib] deflate 1.2.8 -6| 3.099 | 33 MB/s | 390 MB/s |
|
49
|
+
| Compressor | Ratio | Compression | Decompression |
|
50
|
+
| ---------- | ----- | ----------- | ------------- |
|
51
|
+
| memcpy | 1.000 | 13700 MB/s | 13700 MB/s |
|
52
|
+
|**LZ4 default (v1.9.0)** |**2.101**| **780 MB/s**| **4970 MB/s** |
|
53
|
+
| LZO 2.09 | 2.108 | 670 MB/s | 860 MB/s |
|
54
|
+
| QuickLZ 1.5.0 | 2.238 | 575 MB/s | 780 MB/s |
|
55
|
+
| Snappy 1.1.4 | 2.091 | 565 MB/s | 1950 MB/s |
|
56
|
+
| [Zstandard] 1.4.0 -1 | 2.883 | 515 MB/s | 1380 MB/s |
|
57
|
+
| LZF v3.6 | 2.073 | 415 MB/s | 910 MB/s |
|
58
|
+
| [zlib] deflate 1.2.11 -1| 2.730 | 100 MB/s | 415 MB/s |
|
59
|
+
|**LZ4 HC -9 (v1.9.0)** |**2.721**| 41 MB/s | **4900 MB/s** |
|
60
|
+
| [zlib] deflate 1.2.11 -6| 3.099 | 36 MB/s | 445 MB/s |
|
68
61
|
|
69
62
|
[zlib]: http://www.zlib.net/
|
70
63
|
[Zstandard]: http://www.zstd.net/
|
71
64
|
|
72
|
-
LZ4 is also compatible and
|
65
|
+
LZ4 is also compatible and optimized for x32 mode,
|
66
|
+
for which it provides additional speed performance.
|
73
67
|
|
74
68
|
|
75
69
|
Installation
|
@@ -77,7 +71,7 @@ Installation
|
|
77
71
|
|
78
72
|
```
|
79
73
|
make
|
80
|
-
make install # this command may require root
|
74
|
+
make install # this command may require root permissions
|
81
75
|
```
|
82
76
|
|
83
77
|
LZ4's `Makefile` supports standard [Makefile conventions],
|
@@ -89,16 +83,27 @@ It is compatible with parallel builds (`-j#`).
|
|
89
83
|
[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
90
84
|
[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html
|
91
85
|
|
86
|
+
### Building LZ4 - Using vcpkg
|
87
|
+
|
88
|
+
You can download and install LZ4 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
|
89
|
+
|
90
|
+
git clone https://github.com/Microsoft/vcpkg.git
|
91
|
+
cd vcpkg
|
92
|
+
./bootstrap-vcpkg.sh
|
93
|
+
./vcpkg integrate install
|
94
|
+
vcpkg install lz4
|
95
|
+
|
96
|
+
The LZ4 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
92
97
|
|
93
98
|
Documentation
|
94
99
|
-------------------------
|
95
100
|
|
96
101
|
The raw LZ4 block compression format is detailed within [lz4_Block_format].
|
97
102
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
Interoperable versions of LZ4 must respect
|
103
|
+
Arbitrarily long files or data streams are compressed using multiple blocks,
|
104
|
+
for streaming requirements. These blocks are organized into a frame,
|
105
|
+
defined into [lz4_Frame_format].
|
106
|
+
Interoperable versions of LZ4 must also respect the frame format.
|
102
107
|
|
103
108
|
[lz4_Block_format]: doc/lz4_Block_format.md
|
104
109
|
[lz4_Frame_format]: doc/lz4_Frame_format.md
|