diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2025-10-17 20:45:04 -0400 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-10-18 10:40:43 -0400 |
| commit | d7f412e685aee3138213734ad81ffd5fe0e4be8c (patch) | |
| tree | 3aa1e39d4a923924e8dd8e132d6ce3f89fb38fd7 | |
| parent | db357848950d54128d6505621037872e7575697a (diff) | |
Add rb_root_namespace_data_type
| -rw-r--r-- | namespace.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/namespace.c b/namespace.c index c8c947f50c..bd805ae0d3 100644 --- a/namespace.c +++ b/namespace.c @@ -238,6 +238,17 @@ const rb_data_type_t rb_namespace_data_type = { 0, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers }; +const rb_data_type_t rb_root_namespace_data_type = { + "Namespace::Root", + { + rb_namespace_entry_mark, + namespace_entry_free, + namespace_entry_memsize, + rb_namespace_gc_update_references, + }, + 0, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers +}; + VALUE rb_namespace_entry_alloc(VALUE klass) { @@ -708,7 +719,7 @@ initialize_root_namespace(void) root->ns_id = namespace_generate_id(); root->ns_object = root_namespace; - entry = TypedData_Wrap_Struct(rb_cNamespaceEntry, &rb_namespace_data_type, root); + entry = TypedData_Wrap_Struct(rb_cNamespaceEntry, &rb_root_namespace_data_type, root); rb_ivar_set(root_namespace, id_namespace_entry, entry); } else { |
