extzstd 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -14
  3. data/contrib/zstd/CHANGELOG +301 -56
  4. data/contrib/zstd/CONTRIBUTING.md +169 -72
  5. data/contrib/zstd/LICENSE +4 -4
  6. data/contrib/zstd/Makefile +116 -87
  7. data/contrib/zstd/Package.swift +36 -0
  8. data/contrib/zstd/README.md +62 -32
  9. data/contrib/zstd/TESTING.md +2 -3
  10. data/contrib/zstd/appveyor.yml +52 -136
  11. data/contrib/zstd/lib/BUCK +5 -7
  12. data/contrib/zstd/lib/Makefile +225 -222
  13. data/contrib/zstd/lib/README.md +51 -6
  14. data/contrib/zstd/lib/common/allocations.h +55 -0
  15. data/contrib/zstd/lib/common/bits.h +200 -0
  16. data/contrib/zstd/lib/common/bitstream.h +45 -62
  17. data/contrib/zstd/lib/common/compiler.h +205 -22
  18. data/contrib/zstd/lib/common/cpu.h +1 -3
  19. data/contrib/zstd/lib/common/debug.c +1 -1
  20. data/contrib/zstd/lib/common/debug.h +12 -19
  21. data/contrib/zstd/lib/common/entropy_common.c +172 -48
  22. data/contrib/zstd/lib/common/error_private.c +10 -2
  23. data/contrib/zstd/lib/common/error_private.h +82 -3
  24. data/contrib/zstd/lib/common/fse.h +37 -86
  25. data/contrib/zstd/lib/common/fse_decompress.c +117 -92
  26. data/contrib/zstd/lib/common/huf.h +99 -166
  27. data/contrib/zstd/lib/common/mem.h +124 -142
  28. data/contrib/zstd/lib/common/pool.c +54 -27
  29. data/contrib/zstd/lib/common/pool.h +10 -4
  30. data/contrib/zstd/lib/common/portability_macros.h +156 -0
  31. data/contrib/zstd/lib/common/threading.c +74 -19
  32. data/contrib/zstd/lib/common/threading.h +5 -10
  33. data/contrib/zstd/lib/common/xxhash.c +7 -847
  34. data/contrib/zstd/lib/common/xxhash.h +5568 -167
  35. data/contrib/zstd/lib/common/zstd_common.c +2 -37
  36. data/contrib/zstd/lib/common/zstd_deps.h +111 -0
  37. data/contrib/zstd/lib/common/zstd_internal.h +132 -187
  38. data/contrib/zstd/lib/common/zstd_trace.h +163 -0
  39. data/contrib/zstd/lib/compress/clevels.h +134 -0
  40. data/contrib/zstd/lib/compress/fse_compress.c +83 -157
  41. data/contrib/zstd/lib/compress/hist.c +27 -29
  42. data/contrib/zstd/lib/compress/hist.h +2 -2
  43. data/contrib/zstd/lib/compress/huf_compress.c +916 -279
  44. data/contrib/zstd/lib/compress/zstd_compress.c +3773 -1019
  45. data/contrib/zstd/lib/compress/zstd_compress_internal.h +610 -203
  46. data/contrib/zstd/lib/compress/zstd_compress_literals.c +119 -42
  47. data/contrib/zstd/lib/compress/zstd_compress_literals.h +16 -6
  48. data/contrib/zstd/lib/compress/zstd_compress_sequences.c +42 -19
  49. data/contrib/zstd/lib/compress/zstd_compress_sequences.h +1 -1
  50. data/contrib/zstd/lib/compress/zstd_compress_superblock.c +49 -317
  51. data/contrib/zstd/lib/compress/zstd_compress_superblock.h +1 -1
  52. data/contrib/zstd/lib/compress/zstd_cwksp.h +320 -103
  53. data/contrib/zstd/lib/compress/zstd_double_fast.c +388 -151
  54. data/contrib/zstd/lib/compress/zstd_double_fast.h +3 -2
  55. data/contrib/zstd/lib/compress/zstd_fast.c +729 -265
  56. data/contrib/zstd/lib/compress/zstd_fast.h +3 -2
  57. data/contrib/zstd/lib/compress/zstd_lazy.c +1270 -251
  58. data/contrib/zstd/lib/compress/zstd_lazy.h +61 -1
  59. data/contrib/zstd/lib/compress/zstd_ldm.c +324 -219
  60. data/contrib/zstd/lib/compress/zstd_ldm.h +9 -2
  61. data/contrib/zstd/lib/compress/zstd_ldm_geartab.h +106 -0
  62. data/contrib/zstd/lib/compress/zstd_opt.c +481 -209
  63. data/contrib/zstd/lib/compress/zstd_opt.h +1 -1
  64. data/contrib/zstd/lib/compress/zstdmt_compress.c +181 -457
  65. data/contrib/zstd/lib/compress/zstdmt_compress.h +34 -113
  66. data/contrib/zstd/lib/decompress/huf_decompress.c +1199 -565
  67. data/contrib/zstd/lib/decompress/huf_decompress_amd64.S +576 -0
  68. data/contrib/zstd/lib/decompress/zstd_ddict.c +12 -12
  69. data/contrib/zstd/lib/decompress/zstd_ddict.h +2 -2
  70. data/contrib/zstd/lib/decompress/zstd_decompress.c +627 -157
  71. data/contrib/zstd/lib/decompress/zstd_decompress_block.c +1086 -326
  72. data/contrib/zstd/lib/decompress/zstd_decompress_block.h +19 -5
  73. data/contrib/zstd/lib/decompress/zstd_decompress_internal.h +62 -13
  74. data/contrib/zstd/lib/deprecated/zbuff.h +1 -1
  75. data/contrib/zstd/lib/deprecated/zbuff_common.c +1 -1
  76. data/contrib/zstd/lib/deprecated/zbuff_compress.c +24 -4
  77. data/contrib/zstd/lib/deprecated/zbuff_decompress.c +3 -1
  78. data/contrib/zstd/lib/dictBuilder/cover.c +73 -52
  79. data/contrib/zstd/lib/dictBuilder/cover.h +7 -6
  80. data/contrib/zstd/lib/dictBuilder/divsufsort.c +1 -1
  81. data/contrib/zstd/lib/dictBuilder/fastcover.c +44 -35
  82. data/contrib/zstd/lib/dictBuilder/zdict.c +103 -111
  83. data/contrib/zstd/lib/legacy/zstd_legacy.h +8 -1
  84. data/contrib/zstd/lib/legacy/zstd_v01.c +21 -54
  85. data/contrib/zstd/lib/legacy/zstd_v01.h +1 -1
  86. data/contrib/zstd/lib/legacy/zstd_v02.c +29 -70
  87. data/contrib/zstd/lib/legacy/zstd_v02.h +1 -1
  88. data/contrib/zstd/lib/legacy/zstd_v03.c +30 -73
  89. data/contrib/zstd/lib/legacy/zstd_v03.h +1 -1
  90. data/contrib/zstd/lib/legacy/zstd_v04.c +29 -71
  91. data/contrib/zstd/lib/legacy/zstd_v04.h +1 -1
  92. data/contrib/zstd/lib/legacy/zstd_v05.c +40 -86
  93. data/contrib/zstd/lib/legacy/zstd_v05.h +1 -1
  94. data/contrib/zstd/lib/legacy/zstd_v06.c +47 -88
  95. data/contrib/zstd/lib/legacy/zstd_v06.h +1 -1
  96. data/contrib/zstd/lib/legacy/zstd_v07.c +40 -83
  97. data/contrib/zstd/lib/legacy/zstd_v07.h +1 -1
  98. data/contrib/zstd/lib/libzstd.mk +214 -0
  99. data/contrib/zstd/lib/libzstd.pc.in +7 -6
  100. data/contrib/zstd/lib/module.modulemap +35 -0
  101. data/contrib/zstd/lib/{dictBuilder/zdict.h → zdict.h} +203 -34
  102. data/contrib/zstd/lib/zstd.h +1217 -287
  103. data/contrib/zstd/lib/{common/zstd_errors.h → zstd_errors.h} +28 -8
  104. data/ext/extconf.rb +7 -6
  105. data/ext/extzstd.c +19 -10
  106. data/ext/extzstd.h +6 -0
  107. data/ext/libzstd_conf.h +0 -1
  108. data/ext/zstd_decompress_asm.S +1 -0
  109. data/gemstub.rb +3 -21
  110. data/lib/extzstd/version.rb +6 -1
  111. data/lib/extzstd.rb +0 -2
  112. data/test/test_basic.rb +0 -5
  113. metadata +18 -6
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under both the BSD-style license (found in the
@@ -20,19 +20,31 @@ extern "C" {
20
20
 
21
21
 
22
22
  /* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */
23
- #ifndef ZSTDERRORLIB_VISIBILITY
24
- # if defined(__GNUC__) && (__GNUC__ >= 4)
25
- # define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default")))
23
+ #ifndef ZSTDERRORLIB_VISIBLE
24
+ /* Backwards compatibility with old macro name */
25
+ # ifdef ZSTDERRORLIB_VISIBILITY
26
+ # define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY
27
+ # elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
28
+ # define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility ("default")))
26
29
  # else
27
- # define ZSTDERRORLIB_VISIBILITY
30
+ # define ZSTDERRORLIB_VISIBLE
28
31
  # endif
29
32
  #endif
33
+
34
+ #ifndef ZSTDERRORLIB_HIDDEN
35
+ # if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
36
+ # define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility ("hidden")))
37
+ # else
38
+ # define ZSTDERRORLIB_HIDDEN
39
+ # endif
40
+ #endif
41
+
30
42
  #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
31
- # define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBILITY
43
+ # define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE
32
44
  #elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
33
- # define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
45
+ # define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
34
46
  #else
35
- # define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY
47
+ # define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE
36
48
  #endif
37
49
 
38
50
  /*-*********************************************
@@ -58,14 +70,17 @@ typedef enum {
58
70
  ZSTD_error_frameParameter_windowTooLarge = 16,
59
71
  ZSTD_error_corruption_detected = 20,
60
72
  ZSTD_error_checksum_wrong = 22,
73
+ ZSTD_error_literals_headerWrong = 24,
61
74
  ZSTD_error_dictionary_corrupted = 30,
62
75
  ZSTD_error_dictionary_wrong = 32,
63
76
  ZSTD_error_dictionaryCreation_failed = 34,
64
77
  ZSTD_error_parameter_unsupported = 40,
78
+ ZSTD_error_parameter_combination_unsupported = 41,
65
79
  ZSTD_error_parameter_outOfBound = 42,
66
80
  ZSTD_error_tableLog_tooLarge = 44,
67
81
  ZSTD_error_maxSymbolValue_tooLarge = 46,
68
82
  ZSTD_error_maxSymbolValue_tooSmall = 48,
83
+ ZSTD_error_stabilityCondition_notRespected = 50,
69
84
  ZSTD_error_stage_wrong = 60,
70
85
  ZSTD_error_init_missing = 62,
71
86
  ZSTD_error_memory_allocation = 64,
@@ -73,10 +88,15 @@ typedef enum {
73
88
  ZSTD_error_dstSize_tooSmall = 70,
74
89
  ZSTD_error_srcSize_wrong = 72,
75
90
  ZSTD_error_dstBuffer_null = 74,
91
+ ZSTD_error_noForwardProgress_destFull = 80,
92
+ ZSTD_error_noForwardProgress_inputEmpty = 82,
76
93
  /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */
77
94
  ZSTD_error_frameIndex_tooLarge = 100,
78
95
  ZSTD_error_seekableIO = 102,
79
96
  ZSTD_error_dstBuffer_wrong = 104,
97
+ ZSTD_error_srcBuffer_wrong = 105,
98
+ ZSTD_error_sequenceProducer_failed = 106,
99
+ ZSTD_error_externalSequences_invalid = 107,
80
100
  ZSTD_error_maxCode = 120 /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */
81
101
  } ZSTD_ErrorCode;
82
102
 
data/ext/extconf.rb CHANGED
@@ -10,12 +10,13 @@ $INCFLAGS = %w(
10
10
  -I$(srcdir)/../contrib/zstd/lib/legacy
11
11
  ).join(" ") + " #$INCFLAGS"
12
12
 
13
- #dir = File.dirname(__FILE__).gsub(/[\[\{\?\*]/, "[\\0]")
14
- #filepattern = "{.,../contrib/zstd}/**/*.c"
15
- #target = File.join(dir, filepattern)
16
- #files = Dir.glob(target).sort.map { |n| File.basename n }
17
- #$srcs = files
18
- #$VPATH.push "$(srcdir)/../contrib/zstd", "$(srcdir)/../contrib/zstd/legacy"
13
+ #if libzstd が 1.5.1 以降で gcc/clang であれば
14
+ dir = __dir__
15
+ dir1 = dir.gsub(/[\[\{\?\*]/, "[\\0]")
16
+ filepattern = "**/*.[cS]"
17
+ target = File.join(dir1, filepattern)
18
+ $srcs = Dir.glob(target).sort
19
+ #end
19
20
 
20
21
  if RbConfig::CONFIG["arch"] =~ /mingw/i
21
22
  $LDFLAGS << " -static-libgcc" if try_ldflags("-static-libgcc")
data/ext/extzstd.c CHANGED
@@ -3,6 +3,10 @@
3
3
  #include <zstd_errors.h>
4
4
  #include <zdict.h>
5
5
 
6
+ #ifndef RB_EXT_RACTOR_SAFE
7
+ # define RB_EXT_RACTOR_SAFE(FEATURE) ((void)(FEATURE))
8
+ #endif
9
+
6
10
  VALUE extzstd_mZstd;
7
11
 
8
12
  static ID id_initialize;
@@ -167,13 +171,14 @@ init_constants(void)
167
171
  rb_define_const(mConstants, "ZSTD_HASHLOG_MIN", INT2NUM(ZSTD_HASHLOG_MIN));
168
172
  rb_define_const(mConstants, "ZSTD_CHAINLOG_MAX", INT2NUM(ZSTD_CHAINLOG_MAX));
169
173
  rb_define_const(mConstants, "ZSTD_CHAINLOG_MIN", INT2NUM(ZSTD_CHAINLOG_MIN));
170
- rb_define_const(mConstants, "ZSTD_HASHLOG3_MAX", INT2NUM(ZSTD_HASHLOG3_MAX));
171
174
  rb_define_const(mConstants, "ZSTD_SEARCHLOG_MAX", INT2NUM(ZSTD_SEARCHLOG_MAX));
172
175
  rb_define_const(mConstants, "ZSTD_SEARCHLOG_MIN", INT2NUM(ZSTD_SEARCHLOG_MIN));
173
- //rb_define_const(mConstants, "ZSTD_SEARCHLENGTH_MAX", INT2NUM(ZSTD_SEARCHLENGTH_MAX));
174
- //rb_define_const(mConstants, "ZSTD_SEARCHLENGTH_MIN", INT2NUM(ZSTD_SEARCHLENGTH_MIN));
175
- //rb_define_const(mConstants, "ZSTD_TARGETLENGTH_MAX", INT2NUM(ZSTD_TARGETLENGTH_MAX));
176
- //rb_define_const(mConstants, "ZSTD_TARGETLENGTH_MIN", INT2NUM(ZSTD_TARGETLENGTH_MIN));
176
+ rb_define_const(mConstants, "ZSTD_MINMATCH_MAX", INT2NUM(ZSTD_MINMATCH_MAX));
177
+ rb_define_const(mConstants, "ZSTD_MINMATCH_MIN", INT2NUM(ZSTD_MINMATCH_MIN));
178
+ rb_define_const(mConstants, "ZSTD_TARGETLENGTH_MAX", INT2NUM(ZSTD_TARGETLENGTH_MAX));
179
+ rb_define_const(mConstants, "ZSTD_TARGETLENGTH_MIN", INT2NUM(ZSTD_TARGETLENGTH_MIN));
180
+ rb_define_const(mConstants, "ZSTD_STRATEGY_MIN", INT2NUM(ZSTD_STRATEGY_MIN));
181
+ rb_define_const(mConstants, "ZSTD_STRATEGY_MAX", INT2NUM(ZSTD_STRATEGY_MAX));
177
182
 
178
183
  rb_define_const(mConstants, "FAST", INT2NUM(ZSTD_fast));
179
184
  rb_define_const(mConstants, "DFAST", INT2NUM(ZSTD_dfast));
@@ -190,13 +195,15 @@ init_constants(void)
190
195
  rb_define_const(mConstants, "HASHLOG_MIN", INT2NUM(ZSTD_HASHLOG_MIN));
191
196
  rb_define_const(mConstants, "CHAINLOG_MAX", INT2NUM(ZSTD_CHAINLOG_MAX));
192
197
  rb_define_const(mConstants, "CHAINLOG_MIN", INT2NUM(ZSTD_CHAINLOG_MIN));
193
- rb_define_const(mConstants, "HASHLOG3_MAX", INT2NUM(ZSTD_HASHLOG3_MAX));
194
198
  rb_define_const(mConstants, "SEARCHLOG_MAX", INT2NUM(ZSTD_SEARCHLOG_MAX));
195
199
  rb_define_const(mConstants, "SEARCHLOG_MIN", INT2NUM(ZSTD_SEARCHLOG_MIN));
196
- //rb_define_const(mConstants, "SEARCHLENGTH_MAX", INT2NUM(ZSTD_SEARCHLENGTH_MAX));
197
- //rb_define_const(mConstants, "SEARCHLENGTH_MIN", INT2NUM(ZSTD_SEARCHLENGTH_MIN));
198
- //rb_define_const(mConstants, "TARGETLENGTH_MAX", INT2NUM(ZSTD_TARGETLENGTH_MAX));
199
- //rb_define_const(mConstants, "TARGETLENGTH_MIN", INT2NUM(ZSTD_TARGETLENGTH_MIN));
200
+ rb_define_const(mConstants, "MINMATCH_MAX", INT2NUM(ZSTD_MINMATCH_MAX));
201
+ rb_define_const(mConstants, "MINMATCH_MIN", INT2NUM(ZSTD_MINMATCH_MIN));
202
+ rb_define_const(mConstants, "TARGETLENGTH_MAX", INT2NUM(ZSTD_TARGETLENGTH_MAX));
203
+ rb_define_const(mConstants, "TARGETLENGTH_MIN", INT2NUM(ZSTD_TARGETLENGTH_MIN));
204
+ rb_define_const(mConstants, "STRATEGY_MIN", INT2NUM(ZSTD_STRATEGY_MIN));
205
+ rb_define_const(mConstants, "STRATEGY_MAX", INT2NUM(ZSTD_STRATEGY_MAX));
206
+
200
207
  }
201
208
 
202
209
  /*
@@ -613,6 +620,8 @@ init_contextless(void)
613
620
  RBEXT_API void
614
621
  Init_extzstd(void)
615
622
  {
623
+ RB_EXT_RACTOR_SAFE(true);
624
+
616
625
  id_initialize = rb_intern("initialize");
617
626
  id_error_code = rb_intern("error_code");
618
627
 
data/ext/extzstd.h CHANGED
@@ -7,8 +7,10 @@
7
7
  #include <common/zstd_internal.h> /* for MIN() */
8
8
  #include <zstd.h>
9
9
  #include <stdarg.h>
10
+ #include <stdbool.h>
10
11
  #include <ruby.h>
11
12
  #include <ruby/thread.h>
13
+ #include <ruby/version.h>
12
14
 
13
15
  #define ELEMENTOF(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
14
16
  #define ENDOF(ARRAY) (ARRAY + ELEMENTOF(ARRAY))
@@ -226,4 +228,8 @@ aux_string_expand_pointer(VALUE str, char **ptr, size_t size)
226
228
  *ptr = RSTRING_PTR(str);
227
229
  }
228
230
 
231
+ #if RUBY_API_VERSION_CODE >= 30000
232
+ # define rb_obj_infect(dest, src) ((void)(dest), (void)(src))
233
+ #endif
234
+
229
235
  #endif /* EXTZSTD_H */
data/ext/libzstd_conf.h CHANGED
@@ -2,7 +2,6 @@
2
2
  #define RUBY_ZSTD_LIBZSTD_CONF_H 1
3
3
 
4
4
  #define ZSTD_LEGACY_SUPPORT 1
5
- #define MEM_MODULE 1
6
5
  #define visibility(v) visibility("hidden")
7
6
 
8
7
  #endif /* RUBY_ZSTD_LIBZSTD_CONF_H */
@@ -0,0 +1 @@
1
+ #include "../contrib/zstd/lib/decompress/huf_decompress_amd64.S"
data/gemstub.rb CHANGED
@@ -1,13 +1,8 @@
1
- verreg = /^\s*\*\s+version:\s*(\d+(?:\.\w+)+)\s*$/i
2
- unless File.read("README.md", mode: "rt") =~ verreg
3
- raise "``version'' is not defined or bad syntax in ``README.md''"
4
- end
5
-
6
- version = String($1)
1
+ require_relative "lib/extzstd/version"
7
2
 
8
3
  GEMSTUB = Gem::Specification.new do |s|
9
4
  s.name = "extzstd"
10
- s.version = version
5
+ s.version = Zstd::VERSION
11
6
  s.summary = "ruby bindings for Zstandard (zstd)"
12
7
  s.description = <<EOS
13
8
  unoficial ruby bindings for Zstandard (zstd) <https://github.com/facebook/zstd>.
@@ -15,25 +10,12 @@ EOS
15
10
  s.homepage = "https://github.com/dearblue/ruby-extzstd/"
16
11
  s.license = "BSD-2-Clause"
17
12
  s.author = "dearblue"
18
- s.email = "dearblue@users.noreply.github.com"
13
+ s.email = "dearblue@users.osdn.me"
19
14
 
20
15
  s.required_ruby_version = ">= 2.0"
21
16
  s.add_development_dependency "rake", ">= 12.0"
22
17
  end
23
18
 
24
- LIB << "lib/extzstd/version.rb"
25
-
26
- file "lib/extzstd/version.rb" => %w(README.md) do
27
- GEMSTUB.version = version
28
-
29
- mkpath "lib/extzstd"
30
- File.write "lib/extzstd/version.rb", <<-"EOS", mode: "wb"
31
- module Zstd
32
- VERSION = #{version.inspect}
33
- end
34
- EOS
35
- end
36
-
37
19
  EXTRA.concat(FileList["contrib/**/*"])
38
20
 
39
21
  filter = %r(contrib/zstd/(?:build|contrib|doc|examples|lib/dll|programs|tests|zlibWrapper))
@@ -1,3 +1,8 @@
1
1
  module Zstd
2
- VERSION = "0.3.1"
2
+ verreg = /^\s*[\-\*]\s+version:\s*(\d+(?:\.\w+)+)\s*$/i
3
+ unless File.read("#{__dir__}/../../README.md", mode: "rt") =~ verreg
4
+ raise "``version'' is not defined or bad syntax in ``README.md''"
5
+ end
6
+
7
+ VERSION = String($1)
3
8
  end
data/lib/extzstd.rb CHANGED
@@ -4,8 +4,6 @@ ver = RUBY_VERSION.slice(/\d+\.\d+/)
4
4
  soname = File.basename(__FILE__, ".rb") << ".so"
5
5
  require File.join(ver, soname)
6
6
 
7
- require_relative "extzstd/version"
8
-
9
7
  require "stringio"
10
8
 
11
9
  #
data/test/test_basic.rb CHANGED
@@ -9,11 +9,6 @@ class TestZstd < Test::Unit::TestCase
9
9
  src = "ABCDEFGabcdefg" * 50
10
10
  assert_equal(src, Zstd.decode(Zstd.encode(src), src.bytesize))
11
11
  #assert_raise(Zstd::Error) { Zstd.decode("", 1111) }
12
- d1 = Zstd.encode(src)
13
- assert_same(src.tainted?, Zstd.encode(src).tainted?)
14
- src1 = src.dup
15
- src1.taint
16
- assert_same(src1.tainted?, Zstd.encode(src1).tainted?)
17
12
  end
18
13
 
19
14
  def test_huge
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: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - dearblue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-03 00:00:00.000000000 Z
11
+ date: 2023-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -27,7 +27,7 @@ dependencies:
27
27
  description: 'unoficial ruby bindings for Zstandard (zstd) <https://github.com/facebook/zstd>.
28
28
 
29
29
  '
30
- email: dearblue@users.noreply.github.com
30
+ email: dearblue@users.osdn.me
31
31
  executables: []
32
32
  extensions:
33
33
  - ext/extconf.rb
@@ -69,12 +69,15 @@ files:
69
69
  - contrib/zstd/COPYING
70
70
  - contrib/zstd/LICENSE
71
71
  - contrib/zstd/Makefile
72
+ - contrib/zstd/Package.swift
72
73
  - contrib/zstd/README.md
73
74
  - contrib/zstd/TESTING.md
74
75
  - contrib/zstd/appveyor.yml
75
76
  - contrib/zstd/lib/BUCK
76
77
  - contrib/zstd/lib/Makefile
77
78
  - contrib/zstd/lib/README.md
79
+ - contrib/zstd/lib/common/allocations.h
80
+ - contrib/zstd/lib/common/bits.h
78
81
  - contrib/zstd/lib/common/bitstream.h
79
82
  - contrib/zstd/lib/common/compiler.h
80
83
  - contrib/zstd/lib/common/cpu.h
@@ -89,13 +92,16 @@ files:
89
92
  - contrib/zstd/lib/common/mem.h
90
93
  - contrib/zstd/lib/common/pool.c
91
94
  - contrib/zstd/lib/common/pool.h
95
+ - contrib/zstd/lib/common/portability_macros.h
92
96
  - contrib/zstd/lib/common/threading.c
93
97
  - contrib/zstd/lib/common/threading.h
94
98
  - contrib/zstd/lib/common/xxhash.c
95
99
  - contrib/zstd/lib/common/xxhash.h
96
100
  - contrib/zstd/lib/common/zstd_common.c
97
- - contrib/zstd/lib/common/zstd_errors.h
101
+ - contrib/zstd/lib/common/zstd_deps.h
98
102
  - contrib/zstd/lib/common/zstd_internal.h
103
+ - contrib/zstd/lib/common/zstd_trace.h
104
+ - contrib/zstd/lib/compress/clevels.h
99
105
  - contrib/zstd/lib/compress/fse_compress.c
100
106
  - contrib/zstd/lib/compress/hist.c
101
107
  - contrib/zstd/lib/compress/hist.h
@@ -117,11 +123,13 @@ files:
117
123
  - contrib/zstd/lib/compress/zstd_lazy.h
118
124
  - contrib/zstd/lib/compress/zstd_ldm.c
119
125
  - contrib/zstd/lib/compress/zstd_ldm.h
126
+ - contrib/zstd/lib/compress/zstd_ldm_geartab.h
120
127
  - contrib/zstd/lib/compress/zstd_opt.c
121
128
  - contrib/zstd/lib/compress/zstd_opt.h
122
129
  - contrib/zstd/lib/compress/zstdmt_compress.c
123
130
  - contrib/zstd/lib/compress/zstdmt_compress.h
124
131
  - contrib/zstd/lib/decompress/huf_decompress.c
132
+ - contrib/zstd/lib/decompress/huf_decompress_amd64.S
125
133
  - contrib/zstd/lib/decompress/zstd_ddict.c
126
134
  - contrib/zstd/lib/decompress/zstd_ddict.h
127
135
  - contrib/zstd/lib/decompress/zstd_decompress.c
@@ -138,7 +146,6 @@ files:
138
146
  - contrib/zstd/lib/dictBuilder/divsufsort.h
139
147
  - contrib/zstd/lib/dictBuilder/fastcover.c
140
148
  - contrib/zstd/lib/dictBuilder/zdict.c
141
- - contrib/zstd/lib/dictBuilder/zdict.h
142
149
  - contrib/zstd/lib/legacy/zstd_legacy.h
143
150
  - contrib/zstd/lib/legacy/zstd_v01.c
144
151
  - contrib/zstd/lib/legacy/zstd_v01.h
@@ -154,8 +161,12 @@ files:
154
161
  - contrib/zstd/lib/legacy/zstd_v06.h
155
162
  - contrib/zstd/lib/legacy/zstd_v07.c
156
163
  - contrib/zstd/lib/legacy/zstd_v07.h
164
+ - contrib/zstd/lib/libzstd.mk
157
165
  - contrib/zstd/lib/libzstd.pc.in
166
+ - contrib/zstd/lib/module.modulemap
167
+ - contrib/zstd/lib/zdict.h
158
168
  - contrib/zstd/lib/zstd.h
169
+ - contrib/zstd/lib/zstd_errors.h
159
170
  - ext/depend
160
171
  - ext/extconf.rb
161
172
  - ext/extzstd.c
@@ -166,6 +177,7 @@ files:
166
177
  - ext/zstd_common.c
167
178
  - ext/zstd_compress.c
168
179
  - ext/zstd_decompress.c
180
+ - ext/zstd_decompress_asm.S
169
181
  - ext/zstd_dictbuilder.c
170
182
  - ext/zstd_dictbuilder_fastcover.c
171
183
  - ext/zstd_legacy_v01.c
@@ -202,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
214
  - !ruby/object:Gem::Version
203
215
  version: '0'
204
216
  requirements: []
205
- rubygems_version: 3.0.6
217
+ rubygems_version: 3.4.13
206
218
  signing_key:
207
219
  specification_version: 4
208
220
  summary: ruby bindings for Zstandard (zstd)