@@ -57,7 +57,7 @@ static const rb_data_type_t streaming_compress_type = {
5757 streaming_compress_compact ,
5858#endif
5959 },
60- 0 , 0 , RUBY_TYPED_FREE_IMMEDIATELY
60+ 0 , 0 , RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
6161};
6262
6363static VALUE
@@ -66,9 +66,9 @@ rb_streaming_compress_allocate(VALUE klass)
6666 struct streaming_compress_t * sc ;
6767 VALUE obj = TypedData_Make_Struct (klass , struct streaming_compress_t , & streaming_compress_type , sc );
6868 sc -> ctx = NULL ;
69- sc -> buf = Qnil ;
69+ RB_OBJ_WRITE ( obj , & sc -> buf , Qnil ) ;
7070 sc -> buf_size = 0 ;
71- sc -> pending = Qnil ;
71+ RB_OBJ_WRITE ( obj , & sc -> pending , Qnil ) ;
7272 return obj ;
7373}
7474
@@ -89,9 +89,9 @@ rb_streaming_compress_initialize(int argc, VALUE *argv, VALUE obj)
8989 set_compress_params (ctx , kwargs );
9090
9191 sc -> ctx = ctx ;
92- sc -> buf = rb_str_new (NULL , buffOutSize );
92+ RB_OBJ_WRITE ( obj , & sc -> buf , rb_str_new (NULL , buffOutSize ) );
9393 sc -> buf_size = buffOutSize ;
94- sc -> pending = rb_str_new (0 , 0 );
94+ RB_OBJ_WRITE ( obj , & sc -> pending , rb_str_new (0 , 0 ) );
9595
9696 return obj ;
9797}
0 commit comments