vibe_zstd 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e4a4b0e94bb623793a619286308a6e459ecf3e5b23b6ddf668b8fe1063b4bef
4
- data.tar.gz: 98878819233bc19e8d89f63c0f6b610b7c3177ac2d1d062897cf01e25162d2e8
3
+ metadata.gz: 9b3326bfa52942e1f7ee95578bbbff2cd87647748a086742551d562eda6d94f0
4
+ data.tar.gz: b594dade59dab715722477dc6d39eaa7768a39505fef2354c494090462f03afd
5
5
  SHA512:
6
- metadata.gz: 35135f9a6c458690982d7b17494ca6eec5439a901d210226a839be685d533c7c387b2046985fa603c05771bdf7baa2db3cba08faa97da2ac256a38b659f6afa3
7
- data.tar.gz: b739b0318dcc3f88852b974705c2c2e989e96e063def67525d990b96553c2da0dbe6959c741024aaa4c1e88d357969dc6f33580550216e936b098bf910286ea2
6
+ metadata.gz: bb5a4e27578f337ef0a72c133344c8d3f4e229b250f07c771d534bf65ffa40c0588d167e3cf01140d5baa1627e6866080b9710c059f15a59245b48eb7de026e8
7
+ data.tar.gz: 26f0ac03864044c25068cf00c8039d78d7ac677ec1b61298f0bf09fc8918a48a0105785607a53c12bf2c6f5c7a1c3f47d6dc64aefa4ef27e03803509f3717d80
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.1.1] - 2026-03-25
11
+
12
+ ### Fixed
13
+ - Fix `RuntimeError: can't set length of shared string` in `CompressWriter` when writing to File IO on Ruby 3.3+ caused by COW buffer sharing during `IO#write`
14
+ - Fix vendored zstd build flags (`-DZSTD_MULTITHREAD`, `-DXXH_NAMESPACE`, `-DZSTD_LEGACY_SUPPORT`) not propagating to compiled sources, restoring multithreaded compression support (`workers`, `rsyncable` parameters)
15
+
10
16
  ## [1.1.0] - 2026-03-02
11
17
 
12
18
  ### Added
@@ -48,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
48
54
  - Thread pool support for parallel compression
49
55
  - Memory-efficient API for large files
50
56
 
57
+ [1.1.1]: https://github.com/kreynolds/vibe_zstd/compare/v1.1.0...v1.1.1
51
58
  [1.1.0]: https://github.com/kreynolds/vibe_zstd/compare/v1.0.2...v1.1.0
52
59
  [1.0.2]: https://github.com/kreynolds/vibe_zstd/compare/v1.0.1...v1.0.2
53
60
  [1.0.1]: https://github.com/kreynolds/vibe_zstd/compare/v1.0.0...v1.0.1
@@ -14,10 +14,11 @@ $INCFLAGS << " -I#{LIBZSTD_DIR}/decompress"
14
14
  $INCFLAGS << " -I#{LIBZSTD_DIR}/dictBuilder"
15
15
  # standard:enable Style/GlobalVars
16
16
 
17
- # Add preprocessor definitions
18
- append_cflags("-DXXH_NAMESPACE=ZSTD_")
19
- append_cflags("-DZSTD_LEGACY_SUPPORT=0") # Disable legacy support to reduce size
20
- append_cflags("-DZSTD_MULTITHREAD") # Enable multithreading support
17
+ # Add preprocessor definitions (use $defs so they appear in DEFS in the Makefile,
18
+ # append_cflags only validates the flag but doesn't reliably propagate -D flags)
19
+ $defs << "-DXXH_NAMESPACE=ZSTD_"
20
+ $defs << "-DZSTD_LEGACY_SUPPORT=0" # Disable legacy support to reduce size
21
+ $defs << "-DZSTD_MULTITHREAD" # Enable multithreading support
21
22
 
22
23
  # Link with pthread for multithreading
23
24
  have_library("pthread") || abort("pthread library is required for multithreading support")
@@ -116,7 +116,11 @@ vibe_zstd_writer_write(VALUE self, VALUE data) {
116
116
 
117
117
  // Process all input data in chunks
118
118
  while (input.pos < input.size) {
119
- rb_str_set_len(outBuffer, 0); // Reset buffer for reuse
119
+ // Unshare buffer if COW-shared by a prior IO#write receiver (Ruby 3.3+),
120
+ // then restore capacity which may have shrunk during unsharing
121
+ rb_str_modify(outBuffer);
122
+ rb_str_resize(outBuffer, (long)outBufferSize);
123
+ rb_str_set_len(outBuffer, 0);
120
124
  ZSTD_outBuffer output = {
121
125
  .dst = RSTRING_PTR(outBuffer),
122
126
  .size = outBufferSize,
@@ -154,7 +158,9 @@ vibe_zstd_writer_flush(VALUE self) {
154
158
  // ZSTD_e_flush: flush internal buffers, making all data readable
155
159
  // Loop until remaining == 0 (flush complete)
156
160
  do {
157
- rb_str_set_len(outBuffer, 0); // Reset buffer for reuse
161
+ rb_str_modify(outBuffer);
162
+ rb_str_resize(outBuffer, (long)outBufferSize);
163
+ rb_str_set_len(outBuffer, 0);
158
164
  ZSTD_outBuffer output = {
159
165
  .dst = RSTRING_PTR(outBuffer),
160
166
  .size = outBufferSize,
@@ -190,7 +196,9 @@ vibe_zstd_writer_finish(VALUE self) {
190
196
  // ZSTD_e_end: finalize frame with checksum and epilogue
191
197
  // Loop until remaining == 0 (frame complete)
192
198
  do {
193
- rb_str_set_len(outBuffer, 0); // Reset buffer for reuse
199
+ rb_str_modify(outBuffer);
200
+ rb_str_resize(outBuffer, (long)outBufferSize);
201
+ rb_str_set_len(outBuffer, 0);
194
202
  ZSTD_outBuffer output = {
195
203
  .dst = RSTRING_PTR(outBuffer),
196
204
  .size = outBufferSize,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VibeZstd
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vibe_zstd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelley Reynolds
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-03 00:00:00.000000000 Z
10
+ date: 2026-03-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: benchmark-ips