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

Ruby <2.7now uses WeakMap too, which prevents memory leaks. #8341

Merged
merged 1 commit into from Feb 25, 2021

Commits on Feb 25, 2021

  1. Ruby <2.7now uses WeakMap too, which prevents memory leaks.

    Ruby <2.7 does not allow non-finalizable objects to be WeakMap
    keys: https://bugs.ruby-lang.org/issues/16035
    
    We work around this by using a secondary map for Ruby <2.7 which
    maps the non-finalizable integer to a distinct object.
    
    For now we accept that the entries in the secondary map wil never
    be collected.  If this becomes a problem we can perform a GC pass
    every so often that looks at the contents of the object cache to
    decide what can be deleted from the secondary map.
    haberman committed Feb 25, 2021
    Copy the full SHA
    9879f42 View commit details
    Browse the repository at this point in the history