diff options
author | Koichi Sasada <ko1@atdot.net> | 2021-12-21 14:06:02 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-12-21 15:21:30 +0900 |
commit | ad450c9fe51c51626dd07f6e766f47d839cae3ba (patch) | |
tree | f61545a929b263b3df661cd02b8affca12f12637 /vm_core.h | |
parent | 3c7e95966d6b9efd201170eb59b0e4a3c4eb6134 (diff) |
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`.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5316
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 |