[A previous commit](b59077eecf) removes some macro definitions that are used when RGENGC_CHECK_MODE >=4 because they were using data stored against objspace, which is not ractor safe

This commit reinstates those macro definitions, using the current ractor

Co-authored-by: peterzhu2118 <peter@peterzhu.ca>
This commit is contained in:
Matt Valentine-House 2021-01-14 21:33:02 +00:00 коммит произвёл Aaron Patterson
Родитель ed6dc066b6
Коммит 479e4d13cb
1 изменённых файлов: 7 добавлений и 2 удалений

9
gc.c
Просмотреть файл

@ -6729,12 +6729,17 @@ allrefs_roots_i(VALUE obj, void *ptr)
push_mark_stack(&data->mark_stack, obj);
}
}
#define PUSH_MARK_FUNC_DATA(v) do { \
struct gc_mark_func_data_struct *prev_mark_func_data = GET_RACTOR()->mfd; \
GET_RACTOR()->mfd = (v);
#define POP_MARK_FUNC_DATA() GET_RACTOR()->mfd = prev_mark_func_data;} while (0)
static st_table *
objspace_allrefs(rb_objspace_t *objspace)
{
struct allrefs data;
struct mark_func_data_struct mfd;
struct gc_mark_func_data_struct mfd;
VALUE obj;
int prev_dont_gc = dont_gc_val();
dont_gc_on();
@ -6748,7 +6753,7 @@ objspace_allrefs(rb_objspace_t *objspace)
/* traverse root objects */
PUSH_MARK_FUNC_DATA(&mfd);
objspace->mark_func_data = &mfd;
GET_RACTOR()->mfd = &mfd;
gc_mark_roots(objspace, &data.category);
POP_MARK_FUNC_DATA();