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 +4 -4
- data/CHANGELOG.md +7 -0
- data/ext/vibe_zstd/extconf.rb +5 -4
- data/ext/vibe_zstd/streaming.c +11 -3
- data/lib/vibe_zstd/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: 9b3326bfa52942e1f7ee95578bbbff2cd87647748a086742551d562eda6d94f0
|
|
4
|
+
data.tar.gz: b594dade59dab715722477dc6d39eaa7768a39505fef2354c494090462f03afd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/ext/vibe_zstd/extconf.rb
CHANGED
|
@@ -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
|
|
19
|
-
|
|
20
|
-
|
|
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")
|
data/ext/vibe_zstd/streaming.c
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
data/lib/vibe_zstd/version.rb
CHANGED
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.
|
|
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-
|
|
10
|
+
date: 2026-03-25 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: benchmark-ips
|