[ruby/pathname] Fix Init and InitVM

2b63d44453
This commit is contained in:
Nobuyoshi Nakada 2025-07-15 11:44:53 +09:00
parent 6fd108dd6b
commit 4fab4cfe35

View file

@ -1313,6 +1313,8 @@ path_f_pathname(VALUE self, VALUE str)
#include "pathname_builtin.rbinc" #include "pathname_builtin.rbinc"
static void init_ids(void);
/* /*
* *
* Pathname represents the name of a file or directory on the filesystem, * Pathname represents the name of a file or directory on the filesystem,
@ -1503,8 +1505,13 @@ Init_pathname(void)
rb_ext_ractor_safe(true); rb_ext_ractor_safe(true);
#endif #endif
init_ids();
InitVM(pathname); InitVM(pathname);
}
void
InitVM_pathname(void)
{
rb_cPathname = rb_define_class("Pathname", rb_cObject); rb_cPathname = rb_define_class("Pathname", rb_cObject);
rb_define_method(rb_cPathname, "initialize", path_initialize, 1); rb_define_method(rb_cPathname, "initialize", path_initialize, 1);
rb_define_method(rb_cPathname, "freeze", path_freeze, 0); rb_define_method(rb_cPathname, "freeze", path_freeze, 0);
@ -1596,7 +1603,7 @@ Init_pathname(void)
} }
void void
InitVM_pathname(void) init_ids(void)
{ {
#undef rb_intern #undef rb_intern
id_at_path = rb_intern("@path"); id_at_path = rb_intern("@path");