diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2023-03-17 11:29:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2023-03-20 13:54:18 -0700 |
commit | 54dbd8bea8a79bfcdefa471c1717c6cd28022f33 (patch) | |
tree | a192755d979ae7db2a47616450d8a32332855809 /object.c | |
parent | 51834ff2ec4fba7fa4d62b04365c1c9c5b6700f1 (diff) | |
download | ruby-54dbd8bea8a79bfcdefa471c1717c6cd28022f33.tar.gz |
Use an st table for "too complex" objects
st tables will maintain insertion order so we can marshal dump / load
objects with instance variables in the same order they were set on that
particular instance
[ruby-core:112926] [Bug #19535]
Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -281,7 +281,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj) rb_shape_t * src_shape = rb_shape_get_shape(obj); if (rb_shape_id(src_shape) == OBJ_TOO_COMPLEX_SHAPE_ID) { - struct rb_id_table * table = rb_id_table_create(rb_id_table_size(ROBJECT_IV_HASH(obj))); + st_table * table = rb_st_init_numtable_with_size(rb_st_table_size(ROBJECT_IV_HASH(obj))); rb_ivar_foreach(obj, rb_obj_evacuate_ivs_to_hash_table, (st_data_t)table); rb_shape_set_too_complex(dest); |