Skip to content

Commit

Permalink
Implement Write Barriers on proc_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Nov 30, 2023
1 parent 705a3c6 commit 40e67cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions enumerator.c
Expand Up @@ -311,7 +311,7 @@ static const rb_data_type_t proc_entry_data_type = {
proc_entry_memsize,
proc_entry_compact,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};

static struct proc_entry *
Expand Down Expand Up @@ -1875,10 +1875,10 @@ lazy_add_method(VALUE obj, int argc, VALUE *argv, VALUE args, VALUE memo,
VALUE entry_obj = TypedData_Make_Struct(rb_cObject, struct proc_entry,
&proc_entry_data_type, entry);
if (rb_block_given_p()) {
entry->proc = rb_block_proc();
RB_OBJ_WRITE(entry_obj, &entry->proc, rb_block_proc());
}
entry->fn = fn;
entry->memo = args;
RB_OBJ_WRITE(entry_obj, &entry->memo, args);

lazy_set_args(entry_obj, memo);

Expand Down

0 comments on commit 40e67cb

Please sign in to comment.