Skip to content

Commit ec106b1

Browse files
committed
Move rb_ractor_setup_belonging to rb_newobj
1 parent 8f1ae02 commit ec106b1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

gc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,12 @@ rb_newobj(rb_execution_context_t *ec, VALUE klass, VALUE flags, shape_id_t shape
10221022
GC_ASSERT((flags & FL_WB_PROTECTED) == 0);
10231023
rb_ractor_t *cr = rb_ec_ractor_ptr(ec);
10241024
VALUE obj = rb_gc_impl_new_obj(rb_gc_get_objspace(), cr->newobj_cache, klass, flags, wb_protected, size);
1025+
1026+
#if RACTOR_CHECK_MODE
1027+
void rb_ractor_setup_belonging(VALUE obj);
1028+
rb_ractor_setup_belonging(obj);
1029+
#endif
1030+
10251031
RBASIC_SET_SHAPE_ID_NO_CHECKS(obj, shape_id);
10261032

10271033
gc_validate_pc(obj);

gc/default/default.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,12 +2222,6 @@ newobj_init(VALUE klass, VALUE flags, int wb_protected, rb_objspace_t *objspace,
22222222
RBASIC(obj)->shape_id = 0;
22232223
#endif
22242224

2225-
2226-
#if RACTOR_CHECK_MODE
2227-
void rb_ractor_setup_belonging(VALUE obj);
2228-
rb_ractor_setup_belonging(obj);
2229-
#endif
2230-
22312225
#if RGENGC_CHECK_MODE
22322226
int lev = RB_GC_VM_LOCK_NO_BARRIER();
22332227
{

0 commit comments

Comments
 (0)