@@ -213,7 +213,6 @@ class_alloc(VALUE flags, VALUE klass)
213213#endif
214214
215215 /* ZALLOC
216- RCLASS_IV_TBL(obj) = 0;
217216 RCLASS_CONST_TBL(obj) = 0;
218217 RCLASS_M_TBL(obj) = 0;
219218 RCLASS_IV_INDEX_TBL(obj) = 0;
@@ -402,23 +401,19 @@ class_init_copy_check(VALUE clone, VALUE orig)
402401static void
403402copy_tables (VALUE clone , VALUE orig )
404403{
405- if (RCLASS_IV_TBL (clone )) {
406- st_free_table (RCLASS_IV_TBL (clone ));
407- RCLASS_IV_TBL (clone ) = 0 ;
408- }
409404 if (RCLASS_CONST_TBL (clone )) {
410405 rb_free_const_table (RCLASS_CONST_TBL (clone ));
411406 RCLASS_CONST_TBL (clone ) = 0 ;
412407 }
413408 RCLASS_M_TBL (clone ) = 0 ;
414- if (RCLASS_IV_TBL ( orig )) {
409+ if (! RB_TYPE_P ( clone , T_ICLASS )) {
415410 st_data_t id ;
416411
417412 rb_iv_tbl_copy (clone , orig );
418413 CONST_ID (id , "__tmp_classpath__" );
419- st_delete ( RCLASS_IV_TBL ( clone ), & id , 0 );
414+ rb_attr_delete ( clone , id );
420415 CONST_ID (id , "__classpath__" );
421- st_delete ( RCLASS_IV_TBL ( clone ), & id , 0 );
416+ rb_attr_delete ( clone , id );
422417 }
423418 if (RCLASS_CONST_TBL (orig )) {
424419 struct clone_const_arg arg ;
@@ -520,7 +515,6 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
520515 prev_clone_p = clone_p ;
521516 RCLASS_M_TBL (clone_p ) = RCLASS_M_TBL (p );
522517 RCLASS_CONST_TBL (clone_p ) = RCLASS_CONST_TBL (p );
523- RCLASS_IV_TBL (clone_p ) = RCLASS_IV_TBL (p );
524518 RCLASS_ALLOCATOR (clone_p ) = RCLASS_ALLOCATOR (p );
525519 if (RB_TYPE_P (clone , T_CLASS )) {
526520 RCLASS_SET_INCLUDER (clone_p , clone );
@@ -607,9 +601,7 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
607601
608602 RCLASS_SET_SUPER (clone , RCLASS_SUPER (klass ));
609603 RCLASS_ALLOCATOR (clone ) = RCLASS_ALLOCATOR (klass );
610- if (RCLASS_IV_TBL (klass )) {
611- rb_iv_tbl_copy (clone , klass );
612- }
604+ rb_iv_tbl_copy (clone , klass );
613605 if (RCLASS_CONST_TBL (klass )) {
614606 struct clone_const_arg arg ;
615607 arg .tbl = RCLASS_CONST_TBL (clone ) = rb_id_table_create (0 );
@@ -1062,13 +1054,10 @@ rb_include_class_new(VALUE module, VALUE super)
10621054 module = METACLASS_OF (module );
10631055 }
10641056 RUBY_ASSERT (!RB_TYPE_P (module , T_ICLASS ));
1065- if (!RCLASS_IV_TBL (module )) {
1066- RCLASS_IV_TBL (module ) = st_init_numtable ();
1067- }
10681057 if (!RCLASS_CONST_TBL (module )) {
10691058 RCLASS_CONST_TBL (module ) = rb_id_table_create (0 );
10701059 }
1071- RCLASS_IV_TBL ( klass ) = RCLASS_IV_TBL ( module );
1060+
10721061 RCLASS_CVC_TBL (klass ) = RCLASS_CVC_TBL (module );
10731062 RCLASS_CONST_TBL (klass ) = RCLASS_CONST_TBL (module );
10741063
0 commit comments