zstd-ruby 1.5.5.0 → 1.5.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76dbffc6a0a13fccd92ea93abd90e33c4a26ab2ac2972877b7928a515e37033e
4
- data.tar.gz: 21e3eba574ac94d9f34ac0d33732435ed3fd2373e9db921702a74d2a2c9d606a
3
+ metadata.gz: ae3a3eda181783c9e14f147718c560c01e24a9f649feda4c52dcd76cb5e918e3
4
+ data.tar.gz: b02161ceee8747f2f061b235168f8dfedb761db1f303796a4fd75ce6da646706
5
5
  SHA512:
6
- metadata.gz: 4f8c40ad6eaa9b014467fc57651f857713767f7930b2e7e2060c50ff58d05262416d0e9cb1427f440298af577eeef5247daec1866a55003ca6d9b2e2ea6212de
7
- data.tar.gz: 5836f8061f7588081df400bf0705fcc74003029ec9ef9225e43f5ba5a0b19ec747af71cf0e34f150212a5efd90b9e1ea5ebe49a7231297e3f2ab8080bbf8247d
6
+ metadata.gz: 906616393e8f417aff8fa2bac393f5b1215a0f8928cb222f2bcc505b5097d91c69f2179d3fde5c6935112d5c3c167990468d3fd697215c61670fbdd7b1376a17
7
+ data.tar.gz: 15b6a06a46cbf76a2cb725d3fb0ab70b9f8ca9891a04ac013f2043cd2a5b8eff124e19c4c4a1d920410e6d65414c404d3e8e913d3c722f34880960d8e6c126b3
data/.gitignore CHANGED
@@ -19,3 +19,5 @@ vendor/
19
19
  .rspec_status
20
20
 
21
21
  .ruby-version
22
+
23
+ .vscode
data/README.md CHANGED
@@ -87,7 +87,7 @@ result << stream.decompress(cstr[0, 10])
87
87
  result << stream.decompress(cstr[10..-1])
88
88
  ```
89
89
 
90
- ### Skippable flame
90
+ ### Skippable frame
91
91
 
92
92
  ```ruby
93
93
  compressed_data_with_skippable_frame = Zstd.write_skippable_frame(compressed_data, "sample data")
@@ -1,5 +1,7 @@
1
1
  require "mkmf"
2
2
 
3
+ have_func('rb_gc_mark_movable')
4
+
3
5
  $CFLAGS = '-I. -O3 -std=c99 -DZSTD_STATIC_LINKING_ONLY'
4
6
  $CPPFLAGS += " -fdeclspec" if CONFIG['CXX'] =~ /clang/
5
7
 
@@ -11,7 +11,11 @@ static void
11
11
  streaming_compress_mark(void *p)
12
12
  {
13
13
  struct streaming_compress_t *sc = p;
14
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
15
+ rb_gc_mark_movable(sc->buf);
16
+ #else
14
17
  rb_gc_mark(sc->buf);
18
+ #endif
15
19
  }
16
20
 
17
21
  static void
@@ -31,10 +35,26 @@ streaming_compress_memsize(const void *p)
31
35
  return sizeof(struct streaming_compress_t);
32
36
  }
33
37
 
38
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
39
+ static size_t
40
+ streaming_compress_compact(void *p)
41
+ {
42
+ struct streaming_compress_t *sc = p;
43
+ sc->buf = rb_gc_location(sc->buf);
44
+ }
45
+ #endif
46
+
34
47
  static const rb_data_type_t streaming_compress_type = {
35
- "streaming_compress",
36
- { streaming_compress_mark, streaming_compress_free, streaming_compress_memsize, },
37
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
48
+ "streaming_compress",
49
+ {
50
+ streaming_compress_mark,
51
+ streaming_compress_free,
52
+ streaming_compress_memsize,
53
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
54
+ streaming_compress_compact,
55
+ #endif
56
+ },
57
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
38
58
  };
39
59
 
40
60
  static VALUE
@@ -10,7 +10,11 @@ static void
10
10
  streaming_decompress_mark(void *p)
11
11
  {
12
12
  struct streaming_decompress_t *sd = p;
13
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
14
+ rb_gc_mark_movable(sd->buf);
15
+ #else
13
16
  rb_gc_mark(sd->buf);
17
+ #endif
14
18
  }
15
19
 
16
20
  static void
@@ -30,10 +34,26 @@ streaming_decompress_memsize(const void *p)
30
34
  return sizeof(struct streaming_decompress_t);
31
35
  }
32
36
 
37
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
38
+ static size_t
39
+ streaming_decompress_compact(void *p)
40
+ {
41
+ struct streaming_decompress_t *sd = p;
42
+ sd->buf = rb_gc_location(sd->buf);
43
+ }
44
+ #endif
45
+
33
46
  static const rb_data_type_t streaming_decompress_type = {
34
- "streaming_decompress",
35
- { streaming_decompress_mark, streaming_decompress_free, streaming_decompress_memsize, },
36
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
47
+ "streaming_decompress",
48
+ {
49
+ streaming_decompress_mark,
50
+ streaming_decompress_free,
51
+ streaming_decompress_memsize,
52
+ #ifdef HAVE_RB_GC_MARK_MOVABLE
53
+ streaming_decompress_compact,
54
+ #endif
55
+ },
56
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
37
57
  };
38
58
 
39
59
  static VALUE
@@ -1,3 +1,3 @@
1
1
  module Zstd
2
- VERSION = "1.5.5.0"
2
+ VERSION = "1.5.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zstd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.5.0
4
+ version: 1.5.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SpringMT
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-08 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler