Skip to content

Commit

Permalink
Revert "Consider DATA objects without a mark function as protected"
Browse files Browse the repository at this point in the history
This reverts commit 6e4c242.
  • Loading branch information
byroot committed Feb 7, 2023
1 parent 0468071 commit 6eae8e5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gc.c
Expand Up @@ -3110,7 +3110,7 @@ rb_data_object_wrap(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FU
{
RUBY_ASSERT_ALWAYS(dfree != (RUBY_DATA_FUNC)1);
if (klass) rb_data_object_check(klass);
return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap, !dmark, sizeof(struct RTypedData));
return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap, FALSE, sizeof(struct RTypedData));
}

VALUE
Expand All @@ -3126,8 +3126,7 @@ rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *type)
{
RBIMPL_NONNULL_ARG(type);
if (klass) rb_data_object_check(klass);
bool wb_protected = (type->flags & RUBY_FL_WB_PROTECTED) || !type->function.dmark;
return newobj_of(klass, T_DATA, (VALUE)type, (VALUE)1, (VALUE)datap, wb_protected, sizeof(struct RTypedData));
return newobj_of(klass, T_DATA, (VALUE)type, (VALUE)1, (VALUE)datap, type->flags & RUBY_FL_WB_PROTECTED, sizeof(struct RTypedData));
}

VALUE
Expand Down

0 comments on commit 6eae8e5

Please sign in to comment.