aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-12-21 14:06:02 +0900
committerKoichi Sasada <ko1@atdot.net>2021-12-21 15:21:30 +0900
commitad450c9fe51c51626dd07f6e766f47d839cae3ba (patch)
treef61545a929b263b3df661cd02b8affca12f12637 /vm_core.h
parent3c7e95966d6b9efd201170eb59b0e4a3c4eb6134 (diff)
downloadruby-ad450c9fe51c51626dd07f6e766f47d839cae3ba.tar.gz
make `overloaded_cme_table` truly weak key map
`overloaded_cme_table` keeps cme -> monly_cme pairs to manage corresponding `monly_cme` for `cme`. The lifetime of the `monly_cme` should be longer than `monly_cme`, but the previous patch losts the reference to the living `monly_cme`. Now `overloaded_cme_table` values are always root (keys are only weak reference), it means `monly_cme` does not freed until corresponding `cme` is invalidated. To make managing easy, move `overloaded_cme_table` to `rb_vm_t`.
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index 6bbce23078..11866b85e5 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -714,6 +714,7 @@ typedef struct rb_vm_struct {
int builtin_inline_index;
struct rb_id_table *negative_cme_table;
+ st_table *overloaded_cme_table; // cme -> overloaded_cme
#ifndef VM_GLOBAL_CC_CACHE_TABLE_SIZE
#define VM_GLOBAL_CC_CACHE_TABLE_SIZE 1023