Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ext/zstdruby/streaming_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static const rb_data_type_t streaming_compress_type = {
streaming_compress_compact,
#endif
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};

static VALUE
Expand All @@ -66,9 +66,9 @@ rb_streaming_compress_allocate(VALUE klass)
struct streaming_compress_t* sc;
VALUE obj = TypedData_Make_Struct(klass, struct streaming_compress_t, &streaming_compress_type, sc);
sc->ctx = NULL;
sc->buf = Qnil;
RB_OBJ_WRITE(obj, &sc->buf, Qnil);
sc->buf_size = 0;
sc->pending = Qnil;
RB_OBJ_WRITE(obj, &sc->pending, Qnil);
return obj;
}

Expand All @@ -89,9 +89,9 @@ rb_streaming_compress_initialize(int argc, VALUE *argv, VALUE obj)
set_compress_params(ctx, kwargs);

sc->ctx = ctx;
sc->buf = rb_str_new(NULL, buffOutSize);
RB_OBJ_WRITE(obj, &sc->buf, rb_str_new(NULL, buffOutSize));
sc->buf_size = buffOutSize;
sc->pending = rb_str_new(0, 0);
RB_OBJ_WRITE(obj, &sc->pending, rb_str_new(0, 0));

return obj;
}
Expand Down
6 changes: 3 additions & 3 deletions ext/zstdruby/streaming_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static const rb_data_type_t streaming_decompress_type = {
streaming_decompress_compact,
#endif
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};

static VALUE
Expand All @@ -62,7 +62,7 @@ rb_streaming_decompress_allocate(VALUE klass)
struct streaming_decompress_t* sd;
VALUE obj = TypedData_Make_Struct(klass, struct streaming_decompress_t, &streaming_decompress_type, sd);
sd->dctx = NULL;
sd->buf = Qnil;
RB_OBJ_WRITE(obj, &sd->buf, Qnil);
sd->buf_size = 0;
return obj;
}
Expand All @@ -84,7 +84,7 @@ rb_streaming_decompress_initialize(int argc, VALUE *argv, VALUE obj)
set_decompress_params(dctx, kwargs);

sd->dctx = dctx;
sd->buf = rb_str_new(NULL, buffOutSize);
RB_OBJ_WRITE(obj, &sd->buf, rb_str_new(NULL, buffOutSize));
sd->buf_size = buffOutSize;

return obj;
Expand Down
4 changes: 2 additions & 2 deletions ext/zstdruby/zstdruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ static size_t sizeof_ddict(const void *dict)
static const rb_data_type_t cdict_type = {
"Zstd::CDict",
{0, free_cdict, sizeof_cdict,},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};

static const rb_data_type_t ddict_type = {
"Zstd::DDict",
{0, free_ddict, sizeof_ddict,},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};

static VALUE rb_cdict_alloc(VALUE self)
Expand Down