Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make overloaded_cme_table truly weak key map #5316

Merged
merged 1 commit into from Dec 21, 2021

Conversation

ko1
Copy link
Contributor

@ko1 ko1 commented Dec 21, 2021

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.

`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`.
@ko1 ko1 merged commit ad450c9 into ruby:master Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant