diff options
author | Jean Boussier <[email protected]> | 2025-04-26 07:56:54 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-04-26 12:10:32 +0200 |
commit | c0417bd094abcc68be913ce49a430df7cefbcd44 (patch) | |
tree | c9f72a317c8ff86269cdf5389732b179f3ee43ce /vm_method.c | |
parent | e4f85bfc311a3812de7bc2e9d068934e8b364574 (diff) |
Use `set_table` to track const caches
Now that we have a `set_table` implementation, we can
use it to track const caches and save some memory.
We could even save some more memory if `numtable` didn't
store a copy of the `hash` and instead recomputed it every
time, but this is a quick win.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13184
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_method.c b/vm_method.c index 4c534b0583..22adc469f7 100644 --- a/vm_method.c +++ b/vm_method.c @@ -125,7 +125,7 @@ vm_cme_invalidate(rb_callable_method_entry_t *cme) } static int -rb_clear_constant_cache_for_id_i(st_data_t ic, st_data_t idx, st_data_t arg) +rb_clear_constant_cache_for_id_i(st_data_t ic, st_data_t arg) { ((IC) ic)->entry = NULL; return ST_CONTINUE; @@ -141,8 +141,8 @@ rb_clear_constant_cache_for_id(ID id) rb_vm_t *vm = GET_VM(); if (rb_id_table_lookup(vm->constant_cache, id, &lookup_result)) { - st_table *ics = (st_table *)lookup_result; - st_foreach(ics, rb_clear_constant_cache_for_id_i, (st_data_t) NULL); + set_table *ics = (set_table *)lookup_result; + set_foreach(ics, rb_clear_constant_cache_for_id_i, (st_data_t) NULL); ruby_vm_constant_cache_invalidations += ics->num_entries; } |