summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2022-11-29 16:14:13 -0500
committerMaxime Chevalier-Boisvert <[email protected]>2022-11-30 12:23:50 -0500
commita0b0365e905e1ac51998ace7e6fc723406a2f157 ()
tree5523f45099f3a5e2c8cf3112f4acc4cf42d5defe /sample
parentb30248f74a8f6ce37a78f07597c7c5452ff50abd (diff)
YJIT: Deallocate `struct Block` to plug memory s
Previously we essentially never freed block even after invalidation. Their reference count never reached zero for a couple of reasons: 1. `Branch::block` formed a cycle with the block holding the branch 2. Strong count on a branch that has ever contained a stub never reached 0 because we increment the `.clone()` call for `BranchRef::into_raw()` didn't have a matching decrement. It's not safe to immediately deallocate blocks during invalidation since `branch_stub_hit()` can end up running with a branch pointer from an invalidated branch. To plug the s, we wait until code GC or global invalidation and deallocate the blocks for iseqs that are definitely not running.
Notes: Merged: https://.com/ruby/ruby/pull/6833
0 files changed, 0 insertions, 0 deletions