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

Fix Relationship.instances cache. #477

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Mar 9, 2019

  1. Fix Relationship.instances cache.

    This PR aims to fix several issues with Relationship cache:
    
    1) It's not threadsafe, so I propose to use a TLS variable for this.
    2) Memory obtained by cache remains non-freed before the next run of `serialize`. I think it should be freed immediately.
    3) Memory should be freed in `ensure` block to prevent memory bloating in case of exception.
    
    *There are only two hard things in Computer Science: cache invalidation and naming things.*
    marshall-lee committed Mar 9, 2019
    Configuration menu
    Copy the full SHA
    19b6699 View commit details
    Browse the repository at this point in the history
  2. Cache relationship in Hash rather than in Array.

    Also cacle only ids, not entire instances.
    marshall-lee committed Mar 9, 2019
    Configuration menu
    Copy the full SHA
    c6dc227 View commit details
    Browse the repository at this point in the history