Implement Write Barrier for Backtrace::Location

It only has a single reference, set in a single place.
This commit is contained in:
Jean Boussier 2023-02-03 15:20:44 +01:00 коммит произвёл Jean Boussier
Родитель fe5ce1ee41
Коммит 8e7d2cc2ab
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -165,7 +165,7 @@ location_memsize(const void *ptr)
static const rb_data_type_t location_data_type = { static const rb_data_type_t location_data_type = {
"frame_info", "frame_info",
{location_mark, RUBY_TYPED_DEFAULT_FREE, location_memsize,}, {location_mark, RUBY_TYPED_DEFAULT_FREE, location_memsize,},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
}; };
int int
@ -757,7 +757,7 @@ location_create(rb_backtrace_location_t *srcloc, void *btobj)
obj = TypedData_Make_Struct(rb_cBacktraceLocation, struct valued_frame_info, &location_data_type, vloc); obj = TypedData_Make_Struct(rb_cBacktraceLocation, struct valued_frame_info, &location_data_type, vloc);
vloc->loc = srcloc; vloc->loc = srcloc;
vloc->btobj = (VALUE)btobj; RB_OBJ_WRITE(obj, &vloc->btobj, (VALUE)btobj);
return obj; return obj;
} }