zstd-ruby 1.5.5.0 → 1.5.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +2 -2
  4. data/ext/zstdruby/extconf.rb +2 -0
  5. data/ext/zstdruby/libzstd/common/allocations.h +1 -1
  6. data/ext/zstdruby/libzstd/common/bitstream.h +49 -29
  7. data/ext/zstdruby/libzstd/common/compiler.h +114 -22
  8. data/ext/zstdruby/libzstd/common/cpu.h +36 -0
  9. data/ext/zstdruby/libzstd/common/debug.c +6 -0
  10. data/ext/zstdruby/libzstd/common/debug.h +20 -11
  11. data/ext/zstdruby/libzstd/common/error_private.h +45 -36
  12. data/ext/zstdruby/libzstd/common/fse.h +3 -2
  13. data/ext/zstdruby/libzstd/common/fse_decompress.c +19 -17
  14. data/ext/zstdruby/libzstd/common/huf.h +14 -1
  15. data/ext/zstdruby/libzstd/common/mem.h +0 -9
  16. data/ext/zstdruby/libzstd/common/pool.c +1 -1
  17. data/ext/zstdruby/libzstd/common/pool.h +1 -1
  18. data/ext/zstdruby/libzstd/common/portability_macros.h +2 -0
  19. data/ext/zstdruby/libzstd/common/threading.c +8 -2
  20. data/ext/zstdruby/libzstd/common/xxhash.c +5 -11
  21. data/ext/zstdruby/libzstd/common/xxhash.h +2341 -1007
  22. data/ext/zstdruby/libzstd/common/zstd_internal.h +5 -5
  23. data/ext/zstdruby/libzstd/compress/fse_compress.c +8 -7
  24. data/ext/zstdruby/libzstd/compress/huf_compress.c +54 -25
  25. data/ext/zstdruby/libzstd/compress/zstd_compress.c +282 -161
  26. data/ext/zstdruby/libzstd/compress/zstd_compress_internal.h +29 -27
  27. data/ext/zstdruby/libzstd/compress/zstd_compress_superblock.c +224 -113
  28. data/ext/zstdruby/libzstd/compress/zstd_cwksp.h +19 -13
  29. data/ext/zstdruby/libzstd/compress/zstd_double_fast.c +17 -5
  30. data/ext/zstdruby/libzstd/compress/zstd_double_fast.h +11 -0
  31. data/ext/zstdruby/libzstd/compress/zstd_fast.c +14 -6
  32. data/ext/zstdruby/libzstd/compress/zstd_lazy.c +129 -87
  33. data/ext/zstdruby/libzstd/compress/zstd_lazy.h +103 -28
  34. data/ext/zstdruby/libzstd/compress/zstd_ldm.c +8 -2
  35. data/ext/zstdruby/libzstd/compress/zstd_opt.c +216 -112
  36. data/ext/zstdruby/libzstd/compress/zstd_opt.h +31 -7
  37. data/ext/zstdruby/libzstd/compress/zstdmt_compress.c +94 -79
  38. data/ext/zstdruby/libzstd/decompress/huf_decompress.c +188 -126
  39. data/ext/zstdruby/libzstd/decompress/huf_decompress_amd64.S +38 -19
  40. data/ext/zstdruby/libzstd/decompress/zstd_decompress.c +84 -32
  41. data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.c +231 -208
  42. data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.h +1 -1
  43. data/ext/zstdruby/libzstd/decompress/zstd_decompress_internal.h +2 -0
  44. data/ext/zstdruby/libzstd/dictBuilder/cover.c +16 -12
  45. data/ext/zstdruby/libzstd/dictBuilder/cover.h +2 -8
  46. data/ext/zstdruby/libzstd/dictBuilder/fastcover.c +2 -2
  47. data/ext/zstdruby/libzstd/dictBuilder/zdict.c +12 -6
  48. data/ext/zstdruby/libzstd/zstd.h +129 -60
  49. data/ext/zstdruby/streaming_compress.c +23 -3
  50. data/ext/zstdruby/streaming_decompress.c +23 -3
  51. data/lib/zstd-ruby/version.rb +1 -1
  52. metadata +2 -2
@@ -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.6.0"
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.6.0
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