@@ -2138,17 +2138,6 @@ static VALUE class_call_alloc_func(rb_alloc_func_t allocator, VALUE klass);
21382138 *
21392139 */
21402140
2141- static VALUE
2142- rb_class_alloc_m (VALUE klass )
2143- {
2144- rb_alloc_func_t allocator = class_get_alloc_func (klass );
2145- if (!rb_obj_respond_to (klass , rb_intern ("allocate" ), 1 )) {
2146- rb_raise (rb_eTypeError , "calling %" PRIsVALUE ".allocate is prohibited" ,
2147- klass );
2148- }
2149- return class_call_alloc_func (allocator , klass );
2150- }
2151-
21522141static VALUE
21532142rb_class_alloc (VALUE klass )
21542143{
@@ -4603,8 +4592,8 @@ InitVM_Object(void)
46034592 rb_define_method (rb_cModule , "deprecate_constant" , rb_mod_deprecate_constant , -1 ); /* in variable.c */
46044593 rb_define_method (rb_cModule , "singleton_class?" , rb_mod_singleton_p , 0 );
46054594
4606- rb_define_method (rb_singleton_class (rb_cClass ), "allocate" , rb_class_alloc_m , 0 );
4607- rb_define_method (rb_cClass , "allocate" , rb_class_alloc_m , 0 );
4595+ rb_define_method (rb_singleton_class (rb_cClass ), "allocate" , rb_class_alloc , 0 );
4596+ rb_define_method (rb_cClass , "allocate" , rb_class_alloc , 0 );
46084597 rb_define_method (rb_cClass , "new" , rb_class_new_instance_pass_kw , -1 );
46094598 rb_define_method (rb_cClass , "initialize" , rb_class_initialize , -1 );
46104599 rb_define_method (rb_cClass , "superclass" , rb_class_superclass , 0 );
0 commit comments