@@ -1825,13 +1825,13 @@ generic_fields_lookup_ensure_size(st_data_t *k, st_data_t *v, st_data_t u, int e
18251825 if (!existing || fields_lookup -> resize ) {
18261826 if (existing ) {
18271827 RUBY_ASSERT (RSHAPE (fields_lookup -> shape_id )-> type == SHAPE_IVAR || RSHAPE (fields_lookup -> shape_id )-> type == SHAPE_OBJ_ID );
1828- RUBY_ASSERT (RSHAPE (RSHAPE (fields_lookup -> shape_id )-> parent_id )-> capacity < RSHAPE (fields_lookup -> shape_id )-> capacity );
1828+ RUBY_ASSERT (RSHAPE_CAPACITY (RSHAPE (fields_lookup -> shape_id )-> parent_id ) < RSHAPE_CAPACITY (fields_lookup -> shape_id ));
18291829 }
18301830 else {
18311831 FL_SET_RAW ((VALUE )* k , FL_EXIVAR );
18321832 }
18331833
1834- fields_tbl = gen_fields_tbl_resize (fields_tbl , RSHAPE (fields_lookup -> shape_id )-> capacity );
1834+ fields_tbl = gen_fields_tbl_resize (fields_tbl , RSHAPE_CAPACITY (fields_lookup -> shape_id ));
18351835 * v = (st_data_t )fields_tbl ;
18361836 }
18371837
@@ -1940,14 +1940,14 @@ generic_field_set(VALUE obj, shape_id_t target_shape_id, VALUE val)
19401940}
19411941
19421942void
1943- rb_ensure_iv_list_size (VALUE obj , uint32_t current_capacity , uint32_t new_capacity )
1943+ rb_ensure_iv_list_size (VALUE obj , uint32_t current_len , uint32_t new_capacity )
19441944{
19451945 RUBY_ASSERT (!rb_shape_obj_too_complex_p (obj ));
19461946
19471947 if (RBASIC (obj )-> flags & ROBJECT_EMBED ) {
19481948 VALUE * ptr = ROBJECT_FIELDS (obj );
19491949 VALUE * newptr = ALLOC_N (VALUE , new_capacity );
1950- MEMCPY (newptr , ptr , VALUE , current_capacity );
1950+ MEMCPY (newptr , ptr , VALUE , current_len );
19511951 RB_FL_UNSET_RAW (obj , ROBJECT_EMBED );
19521952 ROBJECT (obj )-> as .heap .fields = newptr ;
19531953 }
@@ -2370,13 +2370,13 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
23702370 }
23712371 }
23722372
2373- if (!RSHAPE (dest_shape_id )-> capacity ) {
2373+ if (!RSHAPE_LEN (dest_shape_id )) {
23742374 rb_obj_set_shape_id (dest , dest_shape_id );
23752375 FL_UNSET (dest , FL_EXIVAR );
23762376 return ;
23772377 }
23782378
2379- new_fields_tbl = gen_fields_tbl_resize (0 , RSHAPE (dest_shape_id )-> capacity );
2379+ new_fields_tbl = gen_fields_tbl_resize (0 , RSHAPE_CAPACITY (dest_shape_id ));
23802380
23812381 VALUE * src_buf = obj_fields_tbl -> as .shape .fields ;
23822382 VALUE * dest_buf = new_fields_tbl -> as .shape .fields ;
0 commit comments