@@ -2138,17 +2138,6 @@ static VALUE class_call_alloc_func(rb_alloc_func_t allocator, VALUE klass);
2138
2138
*
2139
2139
*/
2140
2140
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
-
2152
2141
static VALUE
2153
2142
rb_class_alloc (VALUE klass )
2154
2143
{
@@ -4603,8 +4592,8 @@ InitVM_Object(void)
4603
4592
rb_define_method (rb_cModule , "deprecate_constant" , rb_mod_deprecate_constant , -1 ); /* in variable.c */
4604
4593
rb_define_method (rb_cModule , "singleton_class?" , rb_mod_singleton_p , 0 );
4605
4594
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 );
4608
4597
rb_define_method (rb_cClass , "new" , rb_class_new_instance_pass_kw , -1 );
4609
4598
rb_define_method (rb_cClass , "initialize" , rb_class_initialize , -1 );
4610
4599
rb_define_method (rb_cClass , "superclass" , rb_class_superclass , 0 );
0 commit comments