[ruby/fiddle] Mark Closure, Function and Handle as write barrier

protected
(https://github.com/ruby/fiddle/pull/129)

They don't have a mark function, so they don't need any change.

https://github.com/ruby/fiddle/commit/9bbc732aef

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
This commit is contained in:
Jean byroot Boussier 2023-05-26 15:40:29 +02:00 committed by Hiroshi SHIBATA
parent 135d5fa36c
commit f1313caec1
3 changed files with 21 additions and 8 deletions

View File

@ -54,10 +54,13 @@ closure_memsize(const void * ptr)
}
const rb_data_type_t closure_data_type = {
"fiddle/closure",
{0, dealloc, closure_memsize,},
0, 0,
RUBY_TYPED_FREE_IMMEDIATELY,
.wrap_struct_name = "fiddle/closure",
.function = {
.dmark = 0,
.dfree = dealloc,
.dsize = closure_memsize
},
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
};
struct callback_args {

View File

@ -53,8 +53,13 @@ function_memsize(const void *p)
}
const rb_data_type_t function_data_type = {
"fiddle/function",
{0, deallocate, function_memsize,},
.wrap_struct_name = "fiddle/function",
.function = {
.dmark = 0,
.dfree = deallocate,
.dsize = function_memsize
},
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
};
static VALUE

View File

@ -50,8 +50,13 @@ fiddle_handle_memsize(const void *ptr)
}
static const rb_data_type_t fiddle_handle_data_type = {
"fiddle/handle",
{0, fiddle_handle_free, fiddle_handle_memsize,},
.wrap_struct_name = "fiddle/handle",
.function = {
.dmark = 0,
.dfree = fiddle_handle_free,
.dsize = fiddle_handle_memsize
},
.flags = RUBY_TYPED_WB_PROTECTED,
};
/*