From b3fb91f4d1cc651a112e2e26422e76c6f8323eeb Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 23 Oct 2025 09:45:20 -0400 Subject: Make Namespace::Root TypedData inherit from Namespace::Entry The two types of TypedData objects should be treated the same except for the free function. Since Namespace::Root did not inherit from Namespace::Entry, all the TypedData_Get_Struct calls for Namespace::Root would raise "wrong argument type Namespace::Root (expected Namespace::Entry)". --- namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/namespace.c b/namespace.c index b85cbf5715..4e5a4e9bc4 100644 --- a/namespace.c +++ b/namespace.c @@ -268,7 +268,7 @@ const rb_data_type_t rb_root_namespace_data_type = { namespace_entry_memsize, rb_namespace_gc_update_references, }, - 0, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers + &rb_namespace_data_type, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers }; VALUE -- cgit v1.2.3