extzstd 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.ja.md +8 -0
- data/README.md +1 -1
- data/contrib/zstd/CHANGELOG +94 -0
- data/contrib/zstd/CONTRIBUTING.md +351 -1
- data/contrib/zstd/Makefile +32 -10
- data/contrib/zstd/README.md +33 -10
- data/contrib/zstd/TESTING.md +2 -2
- data/contrib/zstd/appveyor.yml +42 -4
- data/contrib/zstd/lib/Makefile +128 -60
- data/contrib/zstd/lib/README.md +47 -16
- data/contrib/zstd/lib/common/bitstream.h +38 -39
- data/contrib/zstd/lib/common/compiler.h +40 -5
- data/contrib/zstd/lib/common/cpu.h +1 -1
- data/contrib/zstd/lib/common/debug.c +11 -31
- data/contrib/zstd/lib/common/debug.h +11 -31
- data/contrib/zstd/lib/common/entropy_common.c +13 -33
- data/contrib/zstd/lib/common/error_private.c +2 -1
- data/contrib/zstd/lib/common/error_private.h +6 -2
- data/contrib/zstd/lib/common/fse.h +12 -32
- data/contrib/zstd/lib/common/fse_decompress.c +12 -35
- data/contrib/zstd/lib/common/huf.h +15 -33
- data/contrib/zstd/lib/common/mem.h +75 -2
- data/contrib/zstd/lib/common/pool.c +8 -4
- data/contrib/zstd/lib/common/pool.h +2 -2
- data/contrib/zstd/lib/common/threading.c +50 -4
- data/contrib/zstd/lib/common/threading.h +36 -4
- data/contrib/zstd/lib/common/xxhash.c +23 -35
- data/contrib/zstd/lib/common/xxhash.h +11 -31
- data/contrib/zstd/lib/common/zstd_common.c +1 -1
- data/contrib/zstd/lib/common/zstd_errors.h +2 -1
- data/contrib/zstd/lib/common/zstd_internal.h +154 -26
- data/contrib/zstd/lib/compress/fse_compress.c +17 -40
- data/contrib/zstd/lib/compress/hist.c +15 -35
- data/contrib/zstd/lib/compress/hist.h +12 -32
- data/contrib/zstd/lib/compress/huf_compress.c +92 -92
- data/contrib/zstd/lib/compress/zstd_compress.c +1191 -1330
- data/contrib/zstd/lib/compress/zstd_compress_internal.h +317 -55
- data/contrib/zstd/lib/compress/zstd_compress_literals.c +158 -0
- data/contrib/zstd/lib/compress/zstd_compress_literals.h +29 -0
- data/contrib/zstd/lib/compress/zstd_compress_sequences.c +419 -0
- data/contrib/zstd/lib/compress/zstd_compress_sequences.h +54 -0
- data/contrib/zstd/lib/compress/zstd_compress_superblock.c +845 -0
- data/contrib/zstd/lib/compress/zstd_compress_superblock.h +32 -0
- data/contrib/zstd/lib/compress/zstd_cwksp.h +525 -0
- data/contrib/zstd/lib/compress/zstd_double_fast.c +65 -43
- data/contrib/zstd/lib/compress/zstd_double_fast.h +2 -2
- data/contrib/zstd/lib/compress/zstd_fast.c +92 -66
- data/contrib/zstd/lib/compress/zstd_fast.h +2 -2
- data/contrib/zstd/lib/compress/zstd_lazy.c +74 -42
- data/contrib/zstd/lib/compress/zstd_lazy.h +1 -1
- data/contrib/zstd/lib/compress/zstd_ldm.c +32 -10
- data/contrib/zstd/lib/compress/zstd_ldm.h +7 -2
- data/contrib/zstd/lib/compress/zstd_opt.c +81 -114
- data/contrib/zstd/lib/compress/zstd_opt.h +1 -1
- data/contrib/zstd/lib/compress/zstdmt_compress.c +95 -51
- data/contrib/zstd/lib/compress/zstdmt_compress.h +3 -2
- data/contrib/zstd/lib/decompress/huf_decompress.c +76 -60
- data/contrib/zstd/lib/decompress/zstd_ddict.c +12 -8
- data/contrib/zstd/lib/decompress/zstd_ddict.h +2 -2
- data/contrib/zstd/lib/decompress/zstd_decompress.c +292 -172
- data/contrib/zstd/lib/decompress/zstd_decompress_block.c +459 -338
- data/contrib/zstd/lib/decompress/zstd_decompress_block.h +3 -3
- data/contrib/zstd/lib/decompress/zstd_decompress_internal.h +18 -4
- data/contrib/zstd/lib/deprecated/zbuff.h +9 -8
- data/contrib/zstd/lib/deprecated/zbuff_common.c +2 -2
- data/contrib/zstd/lib/deprecated/zbuff_compress.c +1 -1
- data/contrib/zstd/lib/deprecated/zbuff_decompress.c +1 -1
- data/contrib/zstd/lib/dictBuilder/cover.c +164 -54
- data/contrib/zstd/lib/dictBuilder/cover.h +52 -7
- data/contrib/zstd/lib/dictBuilder/fastcover.c +60 -43
- data/contrib/zstd/lib/dictBuilder/zdict.c +43 -19
- data/contrib/zstd/lib/dictBuilder/zdict.h +56 -28
- data/contrib/zstd/lib/legacy/zstd_legacy.h +8 -4
- data/contrib/zstd/lib/legacy/zstd_v01.c +110 -110
- data/contrib/zstd/lib/legacy/zstd_v01.h +1 -1
- data/contrib/zstd/lib/legacy/zstd_v02.c +23 -13
- data/contrib/zstd/lib/legacy/zstd_v02.h +1 -1
- data/contrib/zstd/lib/legacy/zstd_v03.c +23 -13
- data/contrib/zstd/lib/legacy/zstd_v03.h +1 -1
- data/contrib/zstd/lib/legacy/zstd_v04.c +30 -17
- data/contrib/zstd/lib/legacy/zstd_v04.h +1 -1
- data/contrib/zstd/lib/legacy/zstd_v05.c +113 -102
- data/contrib/zstd/lib/legacy/zstd_v05.h +2 -2
- data/contrib/zstd/lib/legacy/zstd_v06.c +20 -18
- data/contrib/zstd/lib/legacy/zstd_v06.h +1 -1
- data/contrib/zstd/lib/legacy/zstd_v07.c +25 -19
- data/contrib/zstd/lib/legacy/zstd_v07.h +1 -1
- data/contrib/zstd/lib/libzstd.pc.in +3 -2
- data/contrib/zstd/lib/zstd.h +265 -88
- data/ext/extzstd.h +1 -1
- data/ext/libzstd_conf.h +8 -0
- data/ext/zstd_common.c +1 -3
- data/ext/zstd_compress.c +3 -3
- data/ext/zstd_decompress.c +1 -5
- data/ext/zstd_dictbuilder.c +2 -3
- data/ext/zstd_dictbuilder_fastcover.c +1 -3
- data/ext/zstd_legacy_v01.c +2 -0
- data/ext/zstd_legacy_v02.c +2 -0
- data/ext/zstd_legacy_v03.c +2 -0
- data/ext/zstd_legacy_v04.c +2 -0
- data/ext/zstd_legacy_v05.c +2 -0
- data/ext/zstd_legacy_v06.c +2 -0
- data/ext/zstd_legacy_v07.c +2 -0
- data/lib/extzstd.rb +18 -10
- data/lib/extzstd/version.rb +1 -1
- metadata +15 -6
data/ext/extzstd.h
CHANGED
@@ -183,7 +183,7 @@ aux_const_dig_str_0(VALUE obj, const char *p[], const char **pp)
|
|
183
183
|
# define RBEXT_IMPORT __declspec(dllimport)
|
184
184
|
# define RBEXT_EXPORT __declspec(dllexport)
|
185
185
|
# define RBEXT_LOCAL
|
186
|
-
#elif __GNUC__ >= 4 || __clang__
|
186
|
+
#elif defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__)
|
187
187
|
# define RBEXT_IMPORT __attribute__((visibility("default")))
|
188
188
|
# define RBEXT_EXPORT __attribute__((visibility("default")))
|
189
189
|
# define RBEXT_LOCAL __attribute__((visibility("hidden")))
|
data/ext/libzstd_conf.h
ADDED
data/ext/zstd_common.c
CHANGED
data/ext/zstd_compress.c
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
#
|
2
|
-
#define MEM_MODULE 1
|
3
|
-
#define visibility(v) visibility("hidden")
|
1
|
+
#include "libzstd_conf.h"
|
4
2
|
|
5
3
|
#include "../contrib/zstd/lib/compress/fse_compress.c"
|
6
4
|
#include "../contrib/zstd/lib/compress/huf_compress.c"
|
7
5
|
|
8
6
|
#undef CHECK_F
|
9
7
|
#include "../contrib/zstd/lib/compress/zstd_compress.c"
|
8
|
+
#include "../contrib/zstd/lib/compress/zstd_compress_literals.c"
|
9
|
+
#include "../contrib/zstd/lib/compress/zstd_compress_sequences.c"
|
10
10
|
#include "../contrib/zstd/lib/compress/zstd_double_fast.c"
|
11
11
|
#include "../contrib/zstd/lib/compress/zstd_fast.c"
|
12
12
|
#include "../contrib/zstd/lib/compress/zstd_lazy.c"
|
data/ext/zstd_decompress.c
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
#
|
2
|
-
#define MEM_MODULE 1
|
3
|
-
#define visibility(v) visibility("hidden")
|
1
|
+
#include "libzstd_conf.h"
|
4
2
|
|
5
3
|
#include "../contrib/zstd/lib/decompress/zstd_decompress.c"
|
6
4
|
#include "../contrib/zstd/lib/decompress/zstd_decompress_block.c"
|
7
|
-
|
8
|
-
#undef CHECK_F
|
9
5
|
#include "../contrib/zstd/lib/decompress/huf_decompress.c"
|
10
6
|
#include "../contrib/zstd/lib/decompress/zstd_ddict.c"
|
data/ext/zstd_dictbuilder.c
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#define MEM_MODULE 1
|
3
|
-
#define visibility(v) visibility("hidden")
|
1
|
+
#include "libzstd_conf.h"
|
4
2
|
|
5
3
|
#include "../contrib/zstd/lib/dictBuilder/zdict.c"
|
6
4
|
#include "../contrib/zstd/lib/dictBuilder/divsufsort.c"
|
@@ -8,4 +6,5 @@
|
|
8
6
|
#undef DISPLAY
|
9
7
|
#undef DISPLAYLEVEL
|
10
8
|
#undef DISPLAYUPDATE
|
9
|
+
#define prime4bytes cover_prime4bytes
|
11
10
|
#include "../contrib/zstd/lib/dictBuilder/cover.c"
|
data/ext/zstd_legacy_v01.c
CHANGED
data/ext/zstd_legacy_v02.c
CHANGED
data/ext/zstd_legacy_v03.c
CHANGED
data/ext/zstd_legacy_v04.c
CHANGED
data/ext/zstd_legacy_v05.c
CHANGED
data/ext/zstd_legacy_v06.c
CHANGED
data/ext/zstd_legacy_v07.c
CHANGED
data/lib/extzstd.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
ver = RUBY_VERSION.slice(/\d+\.\d+/)
|
4
4
|
soname = File.basename(__FILE__, ".rb") << ".so"
|
5
|
-
|
5
|
+
require File.join(ver, soname)
|
6
6
|
|
7
7
|
require_relative "extzstd/version"
|
8
8
|
|
@@ -12,13 +12,21 @@ require "stringio"
|
|
12
12
|
# This is ruby bindings for zstd <https://github.com/Cyan4973/zstd> the compression library.
|
13
13
|
#
|
14
14
|
module Zstd
|
15
|
-
module
|
16
|
-
|
15
|
+
module Internals
|
16
|
+
unless String.method_defined? :b
|
17
|
+
refine String do
|
18
|
+
def b
|
19
|
+
dup.force_encoding(Encoding::BINARY)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
25
|
+
using Internals
|
26
|
+
|
19
27
|
refine String do
|
20
28
|
def to_zstd(params = nil, dict: nil)
|
21
|
-
ContextLess.encode(self,
|
29
|
+
ContextLess.encode(self, "".b, nil, dict, params)
|
22
30
|
end
|
23
31
|
|
24
32
|
def unzstd(size = nil, dict: nil)
|
@@ -52,8 +60,8 @@ module Zstd
|
|
52
60
|
# [level = nil (integer or nil)]
|
53
61
|
# [encode_params (instance of Zstd::Parameters)]
|
54
62
|
# [opts dict: nil (string or nil)]
|
55
|
-
def self.encode(src, *args, &block)
|
56
|
-
src.to_zstd(*args, &block)
|
63
|
+
def self.encode(src, *args, **opts, &block)
|
64
|
+
src.to_zstd(*args, **opts, &block)
|
57
65
|
end
|
58
66
|
|
59
67
|
#
|
@@ -62,8 +70,8 @@ module Zstd
|
|
62
70
|
# decode(zstd_stream, dict: nil) -> zstd decoder
|
63
71
|
# decode(zstd_stream, dict: nil) { |decoder| ... } -> yield returned value
|
64
72
|
#
|
65
|
-
def self.decode(src, *args, &block)
|
66
|
-
src.unzstd(*args, &block)
|
73
|
+
def self.decode(src, *args, **opts, &block)
|
74
|
+
src.unzstd(*args, **opts, &block)
|
67
75
|
end
|
68
76
|
|
69
77
|
class << Zstd
|
@@ -94,7 +102,7 @@ module Zstd
|
|
94
102
|
end
|
95
103
|
|
96
104
|
def self.encode(src, params = nil, dest: nil, dict: nil)
|
97
|
-
ContextLess.encode(src, dest ||
|
105
|
+
ContextLess.encode(src, dest || "".b, nil, dict, params)
|
98
106
|
end
|
99
107
|
|
100
108
|
class << Encoder
|
@@ -131,7 +139,7 @@ module Zstd
|
|
131
139
|
|
132
140
|
def self.decode(src, dest: nil, dict: nil)
|
133
141
|
# NOTE: ContextLess.decode は伸長時のサイズが必要なため、常に利用できるわけではない
|
134
|
-
# ContextLess.decode(src, dest ||
|
142
|
+
# ContextLess.decode(src, dest || "".b, nil, dict)
|
135
143
|
|
136
144
|
new(StringIO.new(src), dict).read(nil, dest)
|
137
145
|
end
|
data/lib/extzstd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extzstd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dearblue
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -43,6 +43,7 @@ extra_rdoc_files:
|
|
43
43
|
- ext/extzstd.h
|
44
44
|
- ext/extzstd_nogvls.h
|
45
45
|
- ext/extzstd_stream.c
|
46
|
+
- ext/libzstd_conf.h
|
46
47
|
- ext/zstd_common.c
|
47
48
|
- ext/zstd_compress.c
|
48
49
|
- ext/zstd_decompress.c
|
@@ -101,6 +102,13 @@ files:
|
|
101
102
|
- contrib/zstd/lib/compress/huf_compress.c
|
102
103
|
- contrib/zstd/lib/compress/zstd_compress.c
|
103
104
|
- contrib/zstd/lib/compress/zstd_compress_internal.h
|
105
|
+
- contrib/zstd/lib/compress/zstd_compress_literals.c
|
106
|
+
- contrib/zstd/lib/compress/zstd_compress_literals.h
|
107
|
+
- contrib/zstd/lib/compress/zstd_compress_sequences.c
|
108
|
+
- contrib/zstd/lib/compress/zstd_compress_sequences.h
|
109
|
+
- contrib/zstd/lib/compress/zstd_compress_superblock.c
|
110
|
+
- contrib/zstd/lib/compress/zstd_compress_superblock.h
|
111
|
+
- contrib/zstd/lib/compress/zstd_cwksp.h
|
104
112
|
- contrib/zstd/lib/compress/zstd_double_fast.c
|
105
113
|
- contrib/zstd/lib/compress/zstd_double_fast.h
|
106
114
|
- contrib/zstd/lib/compress/zstd_fast.c
|
@@ -154,6 +162,7 @@ files:
|
|
154
162
|
- ext/extzstd.h
|
155
163
|
- ext/extzstd_nogvls.h
|
156
164
|
- ext/extzstd_stream.c
|
165
|
+
- ext/libzstd_conf.h
|
157
166
|
- ext/zstd_common.c
|
158
167
|
- ext/zstd_compress.c
|
159
168
|
- ext/zstd_decompress.c
|
@@ -174,7 +183,7 @@ homepage: https://github.com/dearblue/ruby-extzstd/
|
|
174
183
|
licenses:
|
175
184
|
- BSD-2-Clause
|
176
185
|
metadata: {}
|
177
|
-
post_install_message:
|
186
|
+
post_install_message:
|
178
187
|
rdoc_options:
|
179
188
|
- "--charset"
|
180
189
|
- UTF-8
|
@@ -193,8 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
202
|
- !ruby/object:Gem::Version
|
194
203
|
version: '0'
|
195
204
|
requirements: []
|
196
|
-
rubygems_version: 3.0.
|
197
|
-
signing_key:
|
205
|
+
rubygems_version: 3.0.6
|
206
|
+
signing_key:
|
198
207
|
specification_version: 4
|
199
208
|
summary: ruby bindings for Zstandard (zstd)
|
200
209
|
test_files: []
|