zstd-ruby 2.0.4 → 2.0.5
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/ext/zstdruby/zstdruby.c +1 -6
- data/lib/zstd-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c3c7ba2ca27786f539bd8083ec97ae1822a529d075147ef1f12f5b565201a3a
|
|
4
|
+
data.tar.gz: 961f3e60ceb142982e9dadec995b4246e77535abb538250f7c488f1ef2e1dab4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3a8b7e573f0c356d7cfaa72416f7f306ccf4d989f17c3265d648956a869f3fa6e166d57a8f0764da070e46014a07fef46b5a05ca814371df5d1d6f470fc595e
|
|
7
|
+
data.tar.gz: 3014a12287071ba7c4d868313ff63e70f99a026f7b0cd28a6c4d5e70a0c0a13497adf0d984a736ca14d5388739c14a10f1342ff01b49d44ba80f59e49f38197f
|
data/ext/zstdruby/zstdruby.c
CHANGED
|
@@ -78,9 +78,7 @@ static VALUE rb_decompress(int argc, VALUE *argv, VALUE self)
|
|
|
78
78
|
StringValue(input_value);
|
|
79
79
|
|
|
80
80
|
size_t in_size = RSTRING_LEN(input_value);
|
|
81
|
-
const unsigned char *
|
|
82
|
-
unsigned char *in = ALLOC_N(unsigned char, in_size);
|
|
83
|
-
memcpy(in, in_r, in_size);
|
|
81
|
+
const unsigned char *in = (const unsigned char *)RSTRING_PTR(input_value);
|
|
84
82
|
|
|
85
83
|
size_t off = 0;
|
|
86
84
|
const uint32_t ZSTD_MAGIC = 0xFD2FB528U;
|
|
@@ -107,14 +105,12 @@ static VALUE rb_decompress(int argc, VALUE *argv, VALUE self)
|
|
|
107
105
|
if (magic == ZSTD_MAGIC) {
|
|
108
106
|
ZSTD_DCtx *dctx = ZSTD_createDCtx();
|
|
109
107
|
if (!dctx) {
|
|
110
|
-
xfree(in);
|
|
111
108
|
rb_raise(rb_eRuntimeError, "ZSTD_createDCtx failed");
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
VALUE out = decode_one_frame(dctx, in + off, in_size - off, kwargs);
|
|
115
112
|
|
|
116
113
|
ZSTD_freeDCtx(dctx);
|
|
117
|
-
xfree(in);
|
|
118
114
|
RB_GC_GUARD(input_value);
|
|
119
115
|
return out;
|
|
120
116
|
}
|
|
@@ -122,7 +118,6 @@ static VALUE rb_decompress(int argc, VALUE *argv, VALUE self)
|
|
|
122
118
|
off += 1;
|
|
123
119
|
}
|
|
124
120
|
|
|
125
|
-
xfree(in);
|
|
126
121
|
RB_GC_GUARD(input_value);
|
|
127
122
|
rb_raise(rb_eRuntimeError, "not a zstd frame (magic not found)");
|
|
128
123
|
}
|
data/lib/zstd-ruby/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zstd-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SpringMT
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-01-08 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bundler
|