Skip to content

Commit d7f412e

Browse files
committed
Add rb_root_namespace_data_type
1 parent db35784 commit d7f412e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

namespace.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,17 @@ const rb_data_type_t rb_namespace_data_type = {
238238
0, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers
239239
};
240240

241+
const rb_data_type_t rb_root_namespace_data_type = {
242+
"Namespace::Root",
243+
{
244+
rb_namespace_entry_mark,
245+
namespace_entry_free,
246+
namespace_entry_memsize,
247+
rb_namespace_gc_update_references,
248+
},
249+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers
250+
};
251+
241252
VALUE
242253
rb_namespace_entry_alloc(VALUE klass)
243254
{
@@ -708,7 +719,7 @@ initialize_root_namespace(void)
708719
root->ns_id = namespace_generate_id();
709720
root->ns_object = root_namespace;
710721

711-
entry = TypedData_Wrap_Struct(rb_cNamespaceEntry, &rb_namespace_data_type, root);
722+
entry = TypedData_Wrap_Struct(rb_cNamespaceEntry, &rb_root_namespace_data_type, root);
712723
rb_ivar_set(root_namespace, id_namespace_entry, entry);
713724
}
714725
else {

0 commit comments

Comments
 (0)