diff options
author | Jean Boussier <byroot@ruby-lang.org> | 2023-11-16 16:28:12 +0100 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2023-11-16 17:49:59 +0100 |
commit | 81b35fe7297957d78715a812f6edecec23c6e3b2 (patch) | |
tree | 9946b12bb5d817ebf599b512ac89e1798b5aa489 /internal | |
parent | b92a92a3fff88a3a39bec72bfc48b1b6e936137e (diff) | |
download | ruby-81b35fe7297957d78715a812f6edecec23c6e3b2.tar.gz |
rb_evict_ivars_to_hash: get rid of the sahpe paramater
It's only used to allocate the table with the right size,
but in some case we were passing `rb_shape_get_shape_by_id(SHAPE_OBJ_TOO_COMPLEX)`
which `next_iv_index` is a bit undefined.
So overall we're better to just allocate a table the size of the existing
object, it should be close enough in the vast majority of cases,
and that's already a de-optimizaton path anyway.
Diffstat (limited to 'internal')
-rw-r--r-- | internal/variable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/variable.h b/internal/variable.h index e7e24d2a15..021e7cc6a8 100644 --- a/internal/variable.h +++ b/internal/variable.h @@ -48,7 +48,7 @@ VALUE rb_mod_set_temporary_name(VALUE, VALUE); struct gen_ivtbl; int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl); int rb_obj_evacuate_ivs_to_hash_table(ID key, VALUE val, st_data_t arg); -void rb_evict_ivars_to_hash(VALUE obj, rb_shape_t * shape); +void rb_evict_ivars_to_hash(VALUE obj); RUBY_SYMBOL_EXPORT_BEGIN /* variable.c (export) */ |