vibe_zstd 1.3.0 → 1.3.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 +5 -0
- data/ext/vibe_zstd/streaming.c +8 -3
- data/ext/vibe_zstd/vibe_zstd.c +8 -0
- 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: f2a7e3f6643d3fd14ebce10d77ba79770d44c11cd82775de3cf2c24eaa84f118
|
|
4
|
+
data.tar.gz: de1a91cfa51e4e49e4759cf39449c309d28c985d2cf9085e1b6e8faed2b07e8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8cb9a59f93e6167df9b7aa0a3ac466f37aae29aeb22aa191951714a694d6dc215f0f008e099f46f60c9e3941352d41c935e470e5301b9fa1cdefb980bf4372b8
|
|
7
|
+
data.tar.gz: 63bb4d19e418c713335da4ed48a05b11ff1af0d8ca025729234bb3416726667a0f2f75ae516918f879811dad3d7d1a2675ed605858ccfcf3b1a0934260b7a138
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.1] - 2026-10-26
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Ruby 4.0 compatibility: `CCtx#compress`, `DCtx#decompress`, `VibeZstd.compress`/`.decompress`, and `CompressWriter#write` raised `FrozenError` when given a frozen string (including `# frozen_string_literal: true` literals). Ruby 4.0 refuses `rb_str_locktmp` on frozen strings; frozen input is already immutable, so the GVL-release lock added in 1.3.0 is now skipped for it. Unfrozen strings are still locked as before.
|
|
14
|
+
|
|
10
15
|
## [1.3.0] - 2026-06-11
|
|
11
16
|
|
|
12
17
|
### Security
|
data/ext/vibe_zstd/streaming.c
CHANGED
|
@@ -174,10 +174,15 @@ vibe_zstd_writer_write(VALUE self, VALUE data) {
|
|
|
174
174
|
// Lock data for the duration of the compress loop so that RSTRING_PTR(data)
|
|
175
175
|
// stays valid even when io.write (called inside the loop) runs Ruby code that
|
|
176
176
|
// could otherwise mutate or resize the string. rb_str_locktmp raises if the
|
|
177
|
-
// string is already locked; the ensure always unlocks it.
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
// string is already locked; the ensure always unlocks it. Frozen strings
|
|
178
|
+
// are already immutable and Ruby 4.0+ refuses to lock them, so skip it.
|
|
180
179
|
vibe_zstd_write_state state = { cstream, data };
|
|
180
|
+
if (OBJ_FROZEN(data)) {
|
|
181
|
+
vibe_zstd_writer_write_body((VALUE)&state);
|
|
182
|
+
return self;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
rb_str_locktmp(data);
|
|
181
186
|
rb_ensure(vibe_zstd_writer_write_body, (VALUE)&state,
|
|
182
187
|
vibe_zstd_writer_write_unlock, data);
|
|
183
188
|
|
data/ext/vibe_zstd/vibe_zstd.c
CHANGED
|
@@ -284,6 +284,10 @@ vibe_zstd_default_c_level(VALUE self) {
|
|
|
284
284
|
// rb_thread_call_without_gvl can deliver a pending async exception (e.g.
|
|
285
285
|
// Thread#raise, Timeout) after reacquiring the GVL, so the unlock must go
|
|
286
286
|
// through rb_ensure or the string would be left permanently locked.
|
|
287
|
+
//
|
|
288
|
+
// Frozen strings are skipped: they cannot be mutated or resized, so the
|
|
289
|
+
// pointer is already stable, and Ruby 4.0+ raises FrozenError from
|
|
290
|
+
// rb_str_locktmp on a frozen string.
|
|
287
291
|
typedef struct {
|
|
288
292
|
void* (*func)(void*);
|
|
289
293
|
void* arg;
|
|
@@ -305,6 +309,10 @@ nogvl_locked_unlock(VALUE str) {
|
|
|
305
309
|
static void
|
|
306
310
|
vibe_zstd_nogvl_with_str_locked(void* (*func)(void*), void* arg, VALUE str) {
|
|
307
311
|
nogvl_locked_call call = { func, arg };
|
|
312
|
+
if (OBJ_FROZEN(str)) {
|
|
313
|
+
nogvl_locked_body((VALUE)&call);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
308
316
|
rb_str_locktmp(str);
|
|
309
317
|
rb_ensure(nogvl_locked_body, (VALUE)&call, nogvl_locked_unlock, str);
|
|
310
318
|
}
|
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.3.
|
|
4
|
+
version: 1.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kelley Reynolds
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-10-28 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: benchmark-ips
|