Skip to content

Commit 2bfa647

Browse files
committed
fix: remove rb_gc_mark from ZSTD context
1 parent 1236bc2 commit 2bfa647

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ext/zstdruby/streaming_compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static void
1111
streaming_compress_mark(void *p)
1212
{
1313
struct streaming_compress_t *sc = p;
14-
rb_gc_mark((VALUE)sc->ctx);
14+
// rb_gc_mark((VALUE)sc->ctx);
1515
rb_gc_mark(sc->buf);
1616
rb_gc_mark(sc->buf_size);
1717
}

ext/zstdruby/streaming_decompress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static void
1010
streaming_decompress_mark(void *p)
1111
{
1212
struct streaming_decompress_t *sd = p;
13-
rb_gc_mark((VALUE)sd->ctx);
13+
// rb_gc_mark((VALUE)sd->ctx);
1414
rb_gc_mark(sd->buf);
1515
rb_gc_mark(sd->buf_size);
1616
}

spec/zstd-ruby-streaming-compress_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
end
1212
end
1313

14+
describe '<< + GC.compat' do
15+
it 'shoud work' do
16+
stream = Zstd::StreamingCompress.new
17+
stream << "abc" << "def"
18+
GC.compact
19+
stream << "ghi"
20+
res = stream.finish
21+
expect(Zstd.decompress(res)).to eq('abcdefghi')
22+
end
23+
end
24+
1425
describe '<< + flush' do
1526
it 'shoud work' do
1627
stream = Zstd::StreamingCompress.new

0 commit comments

Comments
 (0)